Configuration reference

Configuration is component-specific: environment variables are not universal switches. This guide documents which process reads each setting and where its default applies. The standalone server binary, embedded Rust library, CLI, TypeScript subprocess, and optional console have distinct configuration boundaries.

For the supported production deployment, use the Docker-on-Kubernetes contract. Keep credentials in a secret manager or Kubernetes Secret; do not put them in image layers, source control, or browser-visible variables.

Standalone server

SettingDefaultPurpose and constraints
AGENTGUARD_LISTEN / --listentcp://127.0.0.1:8443TCP or tls:// listener URL.
AGENTGUARD_STORE / --store.agentguardPolicy directory containing schema and Cedar policies.
AGENTGUARD_AUDIT / --audit.audit/decisions.jsonlDecision-log destination. The configured destination must be a regular file.
AGENTGUARD_CHAIN_SECRETunsetPath to the HMAC chain secret. Unset means JSONL without cryptographic chaining.
AGENTGUARD_AUTH / --authdisabledBinary accepts disabled, apikey with a separate key-file, or the complete apikey:<path> environment form. Non-loopback production listeners require authentication.
AGENTGUARD_AUTH_KEY_FILE / --auth-key-fileunsetJSON API-key store for --auth apikey; unnecessary when the environment value includes the path.
AGENTGUARD_GRPC_LISTEN / --grpc-listenunsetOptional loopback socket address for the repository-defined gRPC service. Protect the network boundary; the listener is plaintext.
AGENTGUARD_ALLOW_LOOPBACK_BYPASSfalseExplicit bypass for auth-disabled public HTTP binds. Do not expose such a listener to untrusted clients.
RUST_LOGinfo,agentguard=debugtracing-subscriber filter used by the server binary.

Authentication parsing: binary and library

The standalone binary accepts --auth apikey with a separate --auth-key-file, or AGENTGUARD_AUTH=apikey:<path> as one complete environment value. ServerConfig::from_env in the library accepts the same apikey:<path> environment form. The binary and library intentionally have separate configuration surfaces: check agentguard-server --help for the binary and configure ServerConfig / AuthConfig explicitly when embedding.

CLI and TypeScript subprocess

SettingDefaultPurpose and constraints
--store / AGENTGUARD_STORE.agentguardLocal schema and policy directory.
--audit / AGENTGUARD_AUDIT.audit/decisions.jsonlCLI decision log.
--secret-file / AGENTGUARD_CHAIN_SECRETunsetHMAC audit-chain secret file.
--outputprettyUse json for automation.
AGENTGUARD_BINunsetExplicit TypeScript SDK CLI path; ClientOptions.cliBin takes precedence.
AGENTGUARD_TRACEPARENTunsetW3C trace context forwarded to CLI requests by the SDK.
AGENTGUARD_BEARERunsetForwarded by the SDK. The local CLI does not validate it or send it to a PDP.
OPENAI_API_KEY / ANTHROPIC_API_KEYunsetProvider credential for the optional gen command; not used for ordinary authorization.

The TypeScript SDK’s synchronous methods block the calling thread. Use its bounded asynchronous methods in concurrent server handlers; see the API reference.

Cache, audit rotation, and optional library integrations

SettingDefaultPurpose and constraints
AGENTGUARD_CACHE_TTL60sStandalone allow-cache TTL. Malformed values fail startup. Embedded builders receive CacheConfig explicitly.
AGENTGUARD_DENY_CACHE_TTL5sStandalone deny-cache TTL. Malformed values fail startup.
AGENTGUARD_CACHE_CAPACITY10000Positive standalone cache capacity. Malformed or zero values fail startup.
AGENTGUARD_AUDIT_MAX_BYTESunsetStandalone audit rotation threshold in bytes. Unset disables rotation; a configured value must be a positive integer. Embedded builders receive RotationConfig explicitly.
AGENTGUARD_JWKS_REFRESH30sRead by JwtConfig::with_jwks_refresh_from_env; the embedding application owns validator and refresher wiring.
OTEL_EXPORTER_OTLP_ENDPOINTOTel exporter defaultRead by OtlpSink::from_env when the otlp feature is enabled. Setting an endpoint alone does not activate export in the standalone server.
OTEL_SERVICE_NAMEagentguardResource service.name used by OtlpSink.

Optional admin console

The console is a separately deployed Next.js process. Authentication is mandatory; there is no open mode. Its production sessions and rate limits use Redis-compatible shared stores. In-memory implementations are for development and tests only.

SettingDefault / requirementPurpose and constraints
AGENTGUARD_OIDC_ISSUERrequiredOIDC issuer. Production requires HTTPS for the issuer and discovered authorization, token, and JWKS endpoints. Loopback HTTP is development-only.
AGENTGUARD_OIDC_CLIENT_IDrequiredConfidential OIDC client identifier.
AGENTGUARD_OIDC_CLIENT_SECRETrequiredConfidential client secret; provide through a secret manager.
AGENTGUARD_SESSION_SECRETrequired, at least 32 charactersSigns console session and OIDC state cookies.
AGENTGUARD_SESSION_TTL_SECONDS28800Console session lifetime, integer from 300 to 28800 seconds; OIDC role changes take effect on next login.
AGENTGUARD_SESSION_STOREmemory in development; redis in productionShared session backend. Production refuses memory fallback.
AGENTGUARD_SESSION_REDIS_URL / AGENTGUARD_SESSION_REDIS_TOKENrequired for RedisRedis-compatible REST endpoint and credential. Production requires HTTPS; provide credentials separately.
AGENTGUARD_SESSION_REDIS_PREFIXagentguard:session:Optional 1–128 character key namespace. Use a distinct prefix for each environment sharing a database.
AGENTGUARD_RATE_LIMIT_STOREmemory in development; redis in productionShared rate-limit backend. Production refuses memory fallback.
AGENTGUARD_RATE_LIMIT_REDIS_URL / AGENTGUARD_RATE_LIMIT_REDIS_TOKENrequired for RedisRedis-compatible REST endpoint and credential. Production requires HTTPS; provide credentials separately.
AGENTGUARD_RATE_LIMIT_REDIS_PREFIXagentguard:ratelimit:Optional 1–128 character key namespace. Use a distinct prefix for each environment sharing a database.
AGENTGUARD_ADMIN_CLAIMgroupsID-token claim used to resolve the console role.
AGENTGUARD_ADMIN_VALUESemptyComma-separated claim values granting admin. Empty means every signed-in user is a viewer.
AGENTGUARD_PDP_URLhttp://127.0.0.1:8443 in development; required in productionPDP base URL. Production requires HTTPS unless the internal transport exception is enabled.
AGENTGUARD_PDP_ALLOW_INSECURE_INTERNAL0Set to 1 only for an isolated private cluster hop or a service mesh that provides mTLS. Production HTTP targets remain restricted to loopback, private IPs, or cluster-local DNS.
AGENTGUARD_PDP_BEARERunsetServer-side bearer credential sent to the PDP; never expose it to browser code.
AGENTGUARD_STORE.agentguardPolicy store used by CLI-backed console routes.
AGENTGUARD_AUDIT.audit/decisions.jsonlAudit source used by CLI-backed routes.
AGENTGUARD_DELEGATION_KEY_FILEunsetPersistent Ed25519 key required for delegation issuance; the route fails closed when it is unavailable.
AGENTGUARD_TRUST_PROXY_HEADERS0 in development; 1 required in productionTrust only a reverse proxy that removes and replaces forwarded address, host, and scheme headers with validated values.
AGENTGUARD_INSECURE_COOKIEunsetSet to 1 only for local plain-HTTP development; never use in production.

The deployment proxy must terminate TLS and set the external scheme correctly. Read the console deployment guide for readiness checks, role mapping, session behavior, CSRF protections, and failure semantics.

Verify and source references

Inspect the selected command’s --help output and validate a deployment configuration before release. The compatibility policy defines supported runtimes, and the production guide defines the supported deployment contract. The implementation sources are the server binary flags, library configuration, cache implementation, and console environment contract.