Help
Troubleshooting
Common failures — authentication, access policies, decisions you did not expect, approvals, executions, MCP and local setup — and how to fix them.
Every error response carries requestId and traceId; the SDKs expose both on their errors. Search the audit
log by trace (GET /v1/audit/events?traceId=…) or open the trace (GET /v1/traces/{traceId}) to see every
decision the request produced. Error codes are listed in the error reference.
Authentication#
401 unauthenticated with a client secret. Client secrets (gsa_…) are not bearer tokens. Exchange them at
POST /v1/auth/token (grant_type=client_credentials) or let the SDK do it (clientSecret(),
ClientSecretAuth, or GEBSECURE_CLIENT_SECRET). Only access tokens (JWTs) and API keys (gsk_…) are accepted
as Authorization: Bearer. A malformed header is reported as "Malformed Authorization header".
401 after it worked for a while. Access tokens expire after ACCESS_TOKEN_TTL (10 minutes by default). The
SDKs refresh them automatically; if you cache a token yourself, request a new one. A revoked credential, session
or API key also returns 401.
private_key_jwt assertion rejected (invalid_client). iss and sub must be the credential id, aud
must equal {PUBLIC_API_URL}/v1/auth/token exactly (set the SDK's audience when the server's public URL
differs from the URL you call), the assertion must have exp and a fresh jti and be at most five minutes old.
A refresh token stopped working and the user was signed out. Refresh tokens rotate; presenting an
already-used one revokes the whole session family. Always store the newest refresh token
(refreshSession / refresh_session return it), and never retry a refresh on network errors (the SDKs don't).
forbidden with details.reason#
Organization access policies return HTTP 403 forbidden with a reason in details:
details.reason |
Cause | Fix |
|---|---|---|
wrong_region |
The organization's data lives in details.region, but this deployment runs with a different REGION. |
Use that region's API and gateway URLs. Self-hosted single-region setups use REGION=local, which disables the check. |
org_pending_deletion |
The organization is scheduled for deletion (30-day grace period). API keys and machine credentials were revoked when deletion was requested. | An owner can cancel with DELETE /v1/org/deletion; evidence and data-export endpoints remain available. Revoked credentials stay revoked — issue new ones. |
ip_not_allowed |
The client address is not in the organization's ipAllowlist (applied by default to users, API keys and service accounts). |
Call from an allowed network or update ipAllowlist / ipAllowlistScope (PATCH /v1/org). Behind a proxy, set TRUST_PROXY=true so the real client address is used. |
sso_required |
The organization sets enforceSso; password sessions are refused. |
Sign in through SSO (POST /v1/auth/sso/start). |
mfa_required |
The organization sets mfaRequired and this session has no verified second factor. |
Enroll (POST /v1/me/mfa/enroll, then /confirm) or verify (POST /v1/me/mfa/verify); only those endpoints and GET /v1/me/mfa work until then. Logins of users with MFA return mfaRequired: true and a challenge for POST /v1/auth/mfa/challenge. |
forbidden without a reason means a missing permission or scope: check the principal's role and the
credential's scopes (GET /v1/auth/me lists effective permissions).
Unexpected decisions#
DENY with "No policy permits this action (default deny)". No deployed permit matched. Check that the
policy is deployed (not only saved), that its scope contains the agent's environment, and that the action
and resource patterns match (* does not cross /; use **). Replay the request with
POST /v1/policies/simulate or gebsecure simulate --candidate.
DENY with "No permit policy applies to this request". A permit matched the action but a condition was
false or failed to evaluate. A missing attribute is an evaluation error, which makes a permit not apply: guard
optional fields with has(context.x). The decision's explanation.trace shows each candidate's outcome
(not_applicable, error, limit_exceeded, outside_schedule, excepted, risk_out_of_range).
DENY with "Limit exceeded". A limit of the permit is exhausted for its window; limits[].used and
remaining in the decision show the state.
APPROVAL_REQUIRED although no policy requires approval. One of the platform gates applied — look at
explanation.approvals[].policyId:
policyId |
Cause |
|---|---|
risk-threshold |
the risk score exceeded approvalAbove (PATCH /v1/risk/config) |
injection-taint |
the agent read content flagged for prompt injection within taintTtlSeconds and attempts a write, delete or admin action; clear with DELETE /v1/injection/taint/{agentId} after review |
dlp-outbound |
outbound DLP found sensitive data with action REQUIRE_APPROVAL |
org-production-approval |
the organization requires approval for agents in production (requireApprovalInProduction) |
A forbid I expected did not apply — or applied unexpectedly. A forbid whose condition fails to evaluate
applies (fail closed). Check attribute names: the validator warns about unknown_attribute.
Approvals#
approval_required on an administrative call. The organization's two-person rule
(PUT /v1/governance/admin-policies) covers this action. Have a second administrator approve
details.approvalId, then repeat the call with x-gebsecure-approval-id: <approvalId>.
"requesters cannot approve their own actions" / "only humans can approve". Approvals must come from a user other than the requester. Agents cannot approve.
"The action changed since you reviewed it; reload and review again" (409). The snapshotHash sent with the
decision is not the request's current snapshot. Fetch GET /v1/approvals/{id} and decide with its
snapshotHash.
"Approval is approved|rejected|expired|cancelled|consumed" (409) or "You already decided on this approval".
The approval is no longer pending or you already decided; a min 2 approval needs two different people.
Re-authorizing with approvalId fails with forbidden. The approval must belong to the same principal, be
approved (not yet consumed), unexpired, and match the request exactly ("Action does not match the approved
action (snapshot hash mismatch)"). Send the identical action, resource, context and resource attributes.
executeWithApproval reports consumed or "Approval has already been used"#
When the worker is running, approved executions are resumed by the worker about a second after the approval,
which consumes the approval. In SDK 0.2.0 and earlier the helper executeWithApproval (execute_with_approval,
ExecuteWithApproval, ExecuteWithApprovalAsync) re-executed the request itself, so it nondeterministically saw the
approval as consumed and raised ApprovalNotGrantedError, or its re-execution failed with conflict "Approval has
already been used" (or a 400 bad_request "Request violates a data constraint" when both attempts raced).
Upgrade the SDK to 0.2.1, whose helper follows the resumed execution (getExecution) instead of re-executing.
On an older SDK use execute, then waitForApproval, then poll getExecution(executionId) — see
Approvals.
Executions#
denied with error code dlp_blocked. Outbound DLP blocked the input (by default: API keys and credentials
are never sent out). Remove the secret from the input — the connection's credential is injected by the broker —
or adjust the DLP rules.
failed with upstream_error / 502. The external system returned an error; error.upstreamStatus has its
status. Run POST /v1/connections/{id}/health.
unavailable "Circuit open for this connection; retry later". Five upstream failures within 60 seconds
opened the circuit for 30 seconds.
execute against a local service fails before reaching it. The broker refuses private and loopback
addresses and plain HTTP in staging and production. For local development set
EXECUTION_ALLOW_PRIVATE_NETWORKS=true (refused in staging/production).
conflict on execute. The idempotencyKey was used before for a different request. Use a new key for a
different request; the same key with the same request replays the original result (replayed: true).
Retrying a failed execution. POST /v1/executions/{id}/retry (API for people, gateway for agents) runs the
request again as a new attempt linked to the first (retryOf), authorized under the current policies. Every attempt
sends the first attempt's idempotency key to the provider. GET /v1/executions/{id} returns retry, which says
whether a retry is allowed:
409 conflict: an attempt already succeeded, one is still in progress, or this is not the latest attempt.412 precondition_failedwithrequiresConfirmation: a non-idempotent action (e.g. publishing a post) may already have reached the provider (timeout, interruption, 5xx). Check the provider first, then retry with{ "confirm": true }. Denied requests and requests the provider rejected (4xx) need no confirmation.
decisionReason and decisionPolicies on an execution say why it was allowed, denied or held for approval, and by
which policies (granting: true marks the permit that allowed it).
MCP#
JSON-RPC -32000 "Missing Mcp-Session-Id; call initialize first". Send the mcp-session-id header returned
by initialize with every later request.
-32602 "not found" for a session that exists. Sessions are bound to the principal and scope that opened
them; a session from /v1/mcp/github cannot be used on /v1/mcp.
-32001 "Tool … is quarantined (definition changed; pending review)". The upstream tool definition changed
since it was pinned. An administrator reviews it with POST /v1/mcp/servers/{id}/tools/{tool}/review. Tools
flagged as poisoned stay hidden until approved there.
-32002. The agent exceeded the server's rateLimitPerMinute.
Local setup#
Services refuse to start in staging/production. Development defaults (generated keys, KMS_PROVIDER=local
without MASTER_KEY, EXECUTION_ALLOW_PRIVATE_NETWORKS=true) are rejected outside development. Provide real
secrets (TOKEN_SIGNING_KEYS, COOKIE_SECRET, MASTER_KEY or a cloud KMS, VAULT_FINGERPRINT_KEY), as
<NAME>_FILE paths if you use mounted secrets.
Images fail to pull. Base images come from mirror.gcr.io by default; set IMAGE_REGISTRY /
IMAGE_MIRROR in .env to use another registry.
The console cannot call the API (CORS). Add the console's origin to CORS_ORIGINS and set
PUBLIC_CONSOLE_URL.
GET /readyz returns 503. PostgreSQL or Redis is unreachable; the body lists which (checks).