The mandate¶
A person writes .agent_gate/mandate.toml at the project root, or points
AGENT_GATE_MANDATE at a file. The gate looks for .agent_gate/mandate.toml
in the working directory and then in each parent. The gate denies any agent
attempt to change the mandate.
- Without a mandate, every consequential call asks a person. Reads pass.
- Denials count only under the mandate they were made under. A person clears them by changing the mandate.
The ledger¶
The ledger lives in $AGENT_GATE_HOME (default ~/.agent_gate), one JSON
Lines file per session under sessions/. It is append-only. Each entry
holds the first 2,000 characters of the call's input with recognizable
secrets redacted, the verdict, the law, the layer that decided, the reason
and the mandate's digest. A session's file is deleted 30 days after its
last entry.
An annotated mandate¶
This is mandate.example.toml from the repository root:
# Example mandate for agent-gate. Copy to .agent_gate/mandate.toml in the
# project, or point AGENT_GATE_MANDATE at it. A person writes this file; the
# gate denies any agent attempt to edit it.
[mandate]
task = "Fix the failing date parser tests in this repository"
# Paths the agent may write under. Relative paths resolve against the
# directory holding this file's project (the parent of .agent_gate/).
paths = ["."]
# Extra writable paths outside the project, such as scratch directories.
scratch = ["/tmp", "/private/tmp"]
# Network hosts the agent may contact. A subdomain of a listed host matches.
hosts = ["pypi.org", "files.pythonhosted.org"]
# Git remotes the agent may fetch from or push to, matched by host/owner/repo.
git_remotes = ["github.com/Flux-Frontiers/agent_gate"]
# People the agent may contact by email or message.
recipients = []
# MCP tools the agent may call without a prompt, by full tool name.
mcp_tools = ["mcp__pycodekg__query", "mcp__dockg__query"]
[limits]
# After this many denials in one session, every consequential action asks.
max_denials = 3
# Similarity (0-1) at which a new action counts as a retry of a denied one.
retry_similarity = 0.85
# Outward actions (push, publish, PR, email) always ask a person.
outward = "ask"
[model]
# The System 1 gate. Off by default.
enabled = false
# "anthropic": the Claude API; needs `agent-gate-hook[model]` and credentials.
# "openai": any OpenAI-compatible server (oMLX, Ollama) at `endpoint`; the
# value of the `api_key_env` variable, if set, is sent as a bearer token.
backend = "anthropic"
model = "claude-haiku-5-5"
effort = "low"
# For a local model on oMLX instead:
# backend = "openai"
# model = "Qwen3-4B-Instruct-2507-MLX-8bit"
# endpoint = "http://localhost:8080/v1"
# api_key_env = "SYNTH_API_KEY"
timeout_seconds = 20