Reference

Proxy Config

TOML configuration reference for the OpenApe agent proxy.

Proxy Configuration

The @openape/proxy reads its configuration from a TOML file. Two formats are supported: single-agent and multi-agent.

Single-Agent Configuration

[proxy]
listen = "127.0.0.1:9090"
idp_url = "https://id.example.com"
agent_email = "agent+bot@example.com"
default_action = "block"
audit_log = "/var/log/openape-proxy/audit.jsonl"

[[allow]]
domain = "api.github.com"
methods = ["GET"]

[[deny]]
domain = "*.internal.corp"

[[grant_required]]
domain = "api.github.com"
methods = ["POST", "PUT", "DELETE"]
grant_type = "once"

[proxy] Section

FieldTypeRequiredDefaultDescription
listenstringYesBind address and port (e.g., "127.0.0.1:9090")
idp_urlstringYesIdP URL for grant requests
agent_emailstringYesAgent identity email
default_actionstringYesAction for unmatched requests: block, request, request-async
audit_logstringNoPath for JSONL audit log
mandatory_authbooleanNofalseRequire all requests to carry agent auth

Default Actions

ActionBehavior
blockReject unmatched requests with 403
requestAuto-request a grant and block until approved
request-asyncAuto-request a grant, reject current request, retry on next attempt

Multi-Agent Configuration

[proxy]
listen = "127.0.0.1:9090"
default_action = "block"
audit_log = "/var/log/openape-proxy/audit.jsonl"

[[agents]]
email = "agent+deploy@example.com"
idp_url = "https://id.example.com"

  [[agents.allow]]
  domain = "api.github.com"
  methods = ["GET", "POST"]

  [[agents.grant_required]]
  domain = "api.github.com"
  methods = ["DELETE"]
  grant_type = "once"

[[agents]]
email = "agent+monitor@example.com"
idp_url = "https://id.example.com"

  [[agents.allow]]
  domain = "api.datadog.com"

[[agents]] Section

FieldTypeRequiredDescription
emailstringYesAgent identity email
idp_urlstringYesIdP URL for this agent
allowRuleEntry[]NoAgent-specific allow rules
denyRuleEntry[]NoAgent-specific deny rules
grant_requiredGrantRuleEntry[]NoAgent-specific grant rules

Rule Entries

[[allow]] and [[deny]]

FieldTypeRequiredDescription
domainstringYesTarget domain (supports * wildcard)
methodsstring[]NoHTTP methods (default: all)
pathstringNoURL path pattern (supports * wildcard)
notestringNoDocumentation note

[[grant_required]]

All fields from [[allow]] / [[deny]], plus:

FieldTypeRequiredDescription
grant_typestringYesonce, timed, or always
permissionsstring[]NoRequired permissions
durationnumberNoGrant duration in seconds (for timed)

Rule Evaluation Order

  1. deny rules are checked first — if matched, request is blocked
  2. allow rules — if matched, request is forwarded
  3. grant_required rules — if matched, a grant must be approved
  4. default_action — applied when no rule matches

Domain Patterns

PatternMatches
api.github.comExact match
*.github.comAny subdomain of github.com
*Any domain

Audit Log Format

Each entry is a single JSON line:

{
  "ts": "2025-01-15T10:30:00.123Z",
  "agent": "agent+deploy@example.com",
  "action": "allow",
  "domain": "api.github.com",
  "method": "GET",
  "path": "/repos/org/repo",
  "grant_id": null,
  "rule": "allow[0]",
  "waited_ms": 0
}

Audit Actions

ActionDescription
allowRequest was allowed by an allow rule
denyRequest was blocked by a deny rule or default action
grant_approvedGrant was requested and approved
grant_deniedGrant was requested but denied
grant_timeoutGrant was requested but timed out
errorAn error occurred during rule evaluation

CLI Flags

FlagDescription
--config <path>Path to TOML config file (required)
--dry-runEvaluate rules and log decisions, but forward all requests
--mandatory-authRequire agent authentication for all requests