Skip to main content

Configuration

Every control-plane setting is an environment variable with the AGENTIC_AUTH_ prefix, read from the environment or from a .env file in the working directory. Unknown variables are ignored. The sidecar and gateway have their own config files, covered in Deploy the sidecar PEP and Deploy the gateway PEP.

The later controls are off by default. With step-up, cold start, consent granularity, required identity and telemetry all off, you get manifest-driven authorization, token exchange, transaction tokens, taint enforcement and the audit chain, and nothing else.

Core​

VariableDefaultNotes
AGENTIC_AUTH_DATABASE_URLpostgresql+asyncpg://
app:app@localhost:5432/agentic_auth
PostgreSQL 16
AGENTIC_AUTH_REDIS_URLredis://localhost:6379/0Sessions, replay guards, decision cache
AGENTIC_AUTH_ADMIN_TOKENdev-admin-tokenFull-trust bearer for every control-plane write. Replace it before any shared deployment.
AGENTIC_AUTH_DISCOVERY_TIMEOUT_SECONDS5.0RFC 9728 capability discovery during reconciliation

Token issuance​

VariableDefaultNotes
AGENTIC_AUTH_ISSUERagentic-authThe iss on every token the control plane issues
AGENTIC_AUTH_ISSUER_PRIVATE_KEYemptyEd25519 private key, PEM. Empty generates an ephemeral key at startup: every token stops verifying on restart, and two replicas won't agree. Development only.
AGENTIC_AUTH_ISSUER_KIDemptyKey id in the JWKS and each token header. Empty uses the key's thumbprint.
AGENTIC_AUTH_HOP_TOKEN_TTL_SECONDS60Lifetime of one hop token
AGENTIC_AUTH_SESSION_TTL_SECONDS1800How long a session pins its policy version. Sized to one piece of agent work, not a user login.
AGENTIC_AUTH_DECISION_CACHE_TTL_SECONDS30The policy version is part of the cache key, so a session never reads another version's decision

Generate an issuer key with openssl genpkey -algorithm ED25519 -out issuer-key.pem.

Audit and metrics​

VariableDefaultNotes
AGENTIC_AUTH_AUDIT_READ_TOKENemptyRead-only bearer for /v1/audit/* and the identity routes verifiers bootstrap from. Give auditors and resource servers this, not the admin token. Empty disables it.
AGENTIC_AUTH_AUDIT_WRITE_TIMEOUT_SECONDS1.0An allowed call whose audit record can't commit in time is refused with AUDIT_UNAVAILABLE, never dispatched without a record
AGENTIC_AUTH_METRICS_ENABLEDtruePrometheus at /metrics. Internal networks only; labels carry no identities.

Transaction tokens and taint​

VariableDefaultNotes
AGENTIC_AUTH_TRANSACTION_TOKENS_ENABLEDtruePrivileged calls need a call-bound transaction token. false makes POST /v1/token/transaction return 404.
AGENTIC_AUTH_TRANSACTION_TOKEN_TTL_SECONDS30One privileged call, minted right before it
AGENTIC_AUTH_MAX_PRIVILEGED_BODY_BYTES1048576Largest parameter body bound into a transaction token. Larger is refused, never forwarded unbound.
AGENTIC_AUTH_TAINT_ENFORCEMENT_ENABLEDtrueReturn TAINTED_INTO_PRIVILEGED. false still derives and records taint, so you can tune before enforcing.

Identity​

VariableDefaultNotes
AGENTIC_AUTH_IDENTITY_REQUIREDfalseEvery exchange needs proof of possession from an enrolled agent; others are denied AGENT_NOT_ENROLLED. Enroll every agent before turning this on.
AGENTIC_AUTH_ENROLL_TOKENemptyBearer that may begin and complete enrollment. Empty disables it; the admin token always works.
AGENTIC_AUTH_ENROLL_CHALLENGE_TTL_SECONDS120How long an enrollment challenge stays valid
AGENTIC_AUTH_PRINCIPAL_IDP_ISSUERemptyYour human IdP's issuer, for principal binding
AGENTIC_AUTH_PRINCIPAL_IDP_JWKS_URLemptyIts JWKS endpoint
AGENTIC_AUTH_PRINCIPAL_IDP_AUDIENCEemptyThe audience its ID tokens carry for this control plane. Leave the three IdP settings empty and every enrollment completes as quarantined (PRINCIPAL_IDP_NOT_CONFIGURED).
AGENTIC_AUTH_PRINCIPAL_BINDING_CLAIMagentThe ID-token claim that must equal agent://<name>
AGENTIC_AUTH_PRINCIPAL_IDP_ALGORITHMSRS256,ES256,EdDSASigning algorithms accepted on any token from your human IdP: enrollment, step-up and verified consent. none and HS* are refused at startup. Applies with every setting off from 0.4.0; before it, the token's own header chose. Set it if your IdP signs with another algorithm, such as PS256.
AGENTIC_AUTH_REVOCATION_FRESHNESS_SECONDS30How long an offline verifier may go without refreshing revocations before it refuses every identity as stale

Step-up and cold start​

Each is independent and off by default.

VariableDefaultNotes
AGENTIC_AUTH_CONSENT_GRANULARITY_ENABLEDfalseA session may consent to a subset of its policy's data classes. Off, the consented set is the declared set, and data_classes on consent is rejected.
AGENTIC_AUTH_STEP_UP_ENABLEDfalseA recoverable deny carries a step-up challenge, and /v1/consent/step-up* are served. Requires consent granularity: the process refuses to start without it.
AGENTIC_AUTH_STEP_UP_CHALLENGE_TTL_SECONDS300How long a challenge may go unanswered. It can be answered once.
AGENTIC_AUTH_SANDBOX_ENABLEDfalseServe /v1/agents/{id}/sandbox* and the proposal routes. Off, they return 404.
AGENTIC_AUTH_SANDBOX_RUN_DEADLINE_SECONDS300Default length of an observation run

MCP OAuth 2.1 (0.4.0)​

Standard MCP clients sign in at your IdP and call through the connector proxy or gateway. Each setting is off by default; turn them on one at a time. The proxy and gateway side is in the next section. How it fits together: How an MCP client's login becomes per-hop authority.

VariableDefaultNotes
AGENTIC_AUTH_VERIFIED_CONSENT_ENABLEDfalseConsent requires the user's IdP token as subject_token, verifies it against the principal IdP, and roots the session at issuer#subject, recorded as verified. An asserted user_sub alone is refused. Needs PRINCIPAL_IDP_ISSUER, PRINCIPAL_IDP_JWKS_URL and CONSENT_IDP_AUDIENCES, or the process refuses to start.
AGENTIC_AUTH_CONSENT_IDP_AUDIENCESemptyComma-separated audiences a subject_token may carry: this control plane's identifier, and the resource URL of every proxy or gateway that relays tokens to consent
AGENTIC_AUTH_CONSENT_TOKENemptyBearer that may call POST /v1/consent and nothing else. Give it, never the admin token, to a proxy or gateway. Empty disables it.
AGENTIC_AUTH_CLIENT_MAPPING_ENABLEDfalseServe /v1/agents/{id}/clients, and run each session in the scope of the agent its client maps to. An unmapped client is refused with CLIENT_NOT_AUTHORIZED. Requires verified consent.
AGENTIC_AUTH_AS_METADATA_ENABLEDfalseServe authorization server metadata, and check each MCP server's authorization server at registration. Requires ISSUER to be an https URL, which changes iss in new tokens.

Enforcement points​

VariableDefaultNotes
AGENTIC_AUTH_GATEWAY_DECISION_DEADLINE_MS2000Past this the gateway refuses the call, never retries it. Matches the sidecar's control-plane timeout.
AGENTIC_AUTH_DEFAULT_GUARANTEE_LEVELfullThe guarantee_level recorded when an enforcement point predates that field. Every such caller decided per hop, so full is accurate.

As an OAuth protected resource​

Set on each connector proxy (agentic-auth-boundary mcp-proxy) or gateway, with the AGENTIC_AUTH_GATEWAY_ prefix. Available from 0.4.0.

VariableDefaultNotes
AGENTIC_AUTH_GATEWAY_OAUTH_RESOURCE_ENABLEDfalsePublish Protected Resource Metadata, challenge with 401, validate the IdP token locally and start sessions through consent. Refused together with observe mode.
AGENTIC_AUTH_GATEWAY_RESOURCE_URLemptyRequired. This proxy's public https URL: the resource in its metadata, and the audience inbound tokens must carry. http://localhost only with AGENTIC_AUTH_DEV=true.
AGENTIC_AUTH_GATEWAY_IDP_ISSUERemptyRequired. Your IdP's issuer, named as the authorization server
AGENTIC_AUTH_GATEWAY_IDP_JWKS_URLemptyOverrides the jwks_uri from the IdP's discovery document. The keys are fetched before serving; if they cannot be, the process does not start.
AGENTIC_AUTH_GATEWAY_IDP_ALGORITHMSRS256,ES256,EdDSAAccepted signing algorithms. none and HS* are refused at startup
AGENTIC_AUTH_GATEWAY_CLOCK_LEEWAY_SECONDS60Tolerated clock skew, at most 300
AGENTIC_AUTH_GATEWAY_CONSENT_TOKENemptyRequired. The control plane's CONSENT_TOKEN
AGENTIC_AUTH_GATEWAY_CONSENT_SCOPEemptyThe scope to start sessions in. Leave empty when client mapping chooses it
AGENTIC_AUTH_GATEWAY_ASSERTED_ROOT_SCOPEemptyOnly for a control plane with verified consent off. Sessions are rooted in an asserted subject and say so. A step on the way to verified consent, not a place to stay
AGENTIC_AUTH_GATEWAY_SESSION_CACHE_SIZE10000Sessions kept in memory, one per IdP token, until the earlier of the token's and the session's expiry

A connector proxy route may also set relay_authorization: an operator credential sent upstream on relayed methods such as initialize and tools/list. From 0.4.0 the client's own Authorization, Cookie and Proxy-Authorization headers are never relayed, with every setting off.

There is deliberately no control-plane observe mode. The PDP always decides and records honestly; observe mode belongs to each enforcement point (observe_mode in a sidecar or gateway config), the only component that knows whether it will act on a deny.

Telemetry​

Off by default, and the OpenTelemetry SDK is never imported while it's off. Install with pip install 'authzai[otel]'. Where telemetry goes is set with the standard OTEL_* variables. Metrics stay on /metrics.

VariableDefaultNotes
AGENTIC_AUTH_TELEMETRY_ENABLEDfalse
AGENTIC_AUTH_TELEMETRY_KEYemptyRequired when telemetry is on. Keys the pseudonyms in traces and logs. Empty, the exporter refuses to start and logs once, and the process still serves traffic. There is no plaintext fallback. Generate one with openssl rand -hex 32.
AGENTIC_AUTH_TELEMETRY_IDENTITY_DISCLOSUREfalseExport real agent names instead of pseudonyms. Its state is exported too, so you can alert on it. Metric labels never carry identities either way.
AGENTIC_AUTH_TELEMETRY_ALLOW_SAMPLE_RATIO1.0Fraction of allow spans kept. Refusals are always exported.

With more than one worker, set PROMETHEUS_MULTIPROC_DIR to an empty writable directory so /metrics aggregates across them.