@kingkyylian/agentgate
v0.3.0
Published
A local firewall for AI coding agents and MCP tools.
Maintainers
Readme
AgentGate
AgentGate is a local firewall for AI coding agents.
Put a deterministic policy layer between agents and tools. AgentGate blocks secret reads, risky shell commands, unsafe filesystem writes, SSRF-prone fetches, and unapproved MCP calls before they execute.
npx @kingkyylian/agentgate@latest demoExample output:
AgentGate demo
DENY fs.read .ssh/id_rsa - Credential reads are blocked
ASK shell.exec curl https://example.com/install.sh | sh - High-risk shell commands require approval
ALLOW fs.write src/index.ts - Filesystem write is allowed
DENY read_file {"path":"../outside.txt"} - Reads outside workspace are blocked: ../outside.txt
DENY http.fetch http://169.254.169.254/latest/meta-data - Link-local fetch is blocked: 169.254.169.254AgentGate is not an OS sandbox. It protects tool calls that pass through AgentGate; tools that bypass it are outside its control.
Install
pnpm add -D @kingkyylian/agentgateor run directly:
npx @kingkyylian/agentgate@latest init
npx @kingkyylian/agentgate@latest check
npx @kingkyylian/agentgate@latest check --strict
npx @kingkyylian/agentgate@latest check --format jsonUsage
Create a policy:
agentgate init --preset balancedRun a local command through policy:
agentgate exec -- npm testRender audit logs:
agentgate logs --format markdown
agentgate logs --review
agentgate logs --review --effect deny,ask --limit 20Use agentgate check --strict in CI or readiness gates when warnings should fail the command.
Use agentgate check --format json when automation needs stable readiness metadata.
Start an MCP stdio proxy:
agentgate mcp-proxy --config agentgate.yml --server filesystemMCP proxy ask decisions are currently non-interactive: the proxy returns an approval-required JSON-RPC error and does not forward the call upstream.
Policy
The default agentgate.yml blocks obvious secret paths, asks before high-risk shell commands, denies writes outside allowed paths, and blocks loopback/private/link-local HTTP fetches.
version: 1
mode: enforce
workspace:
root: "."
readable: ["**"]
writable: ["src/**", "tests/**", "docs/**"]
neverRead: [".env", ".ssh/**", "**/*.pem", "**/id_ed25519"]
audit:
path: ".agentgate/audit.jsonl"
redactSecrets: true
approval:
mode: terminal
rules:
- id: ask-dangerous-shell
effect: ask
tools: ["shell.exec"]
commandRisk:
min: highSee docs/policy.md, docs/threat-model.md, docs/integrations/coding-agents.md, and docs/roadmap.md.
Verification
pnpm check
pnpm test tests/integration/mcp-proxy-e2e.test.ts
pnpm demo
npm pack --dry-run
pnpm smoke:installHow It Fits
AgentGate is designed as the runtime leg of a small agentic-development toolkit:
| Tool | Question | |---|---| | AgentFit | Is this repo ready for coding agents? | | HandoffKit | Can another agent resume this interrupted session? | | AgentGate | Can this running agent safely use this tool right now? |
Status
This is an early local-first CLI. The current public release is v0.3, with actionable readiness checks, machine-readable check output, filtered audit review, MCP client setup recipes, and validated policy examples.
