Architecture, security model, demos, and everything under the hood. โ Back to overview
You're running AI on an isolated machine. Smart. But now it needs your files, your repos, your tools...
Full filesystem access. Agent gets pwned โ you get pwned.
Credentials stored on agent machine. Same problem.
Tedious. Breaks flow. Doesn't scale.
Your code on someone else's servers.
None of these assume the agent might be compromised. But it might be - prompt injection is real.
Grant specific paths, specific tools, specific operations, for a specific time. Nothing more.
Assumes the agent machine is compromised. Because it might be.
Grant ~/projects/app/** not "everything".
Tokens expire. 1 hour, 24 hours, 7 days - you choose.
Revoke tokens instantly. Dead credential, even if the agent still holds it.
Every operation logged with path, tool, timestamp, and result.
clawgate keygen
clawgate grant --read "~/projects/**" --ttl 24h > token.txt
# Or with git access:
clawgate grant --git "~/projects/**" --ttl 24h > token.txt
# Or grant a registered tool:
clawgate grant --tool web-fetch --ttl 4h > token.txt
scp ~/.clawgate/keys/public.key token.txt agent-machine:
mkdir -p ~/.clawgate/keys
mv public.key ~/.clawgate/keys/
clawgate token add "$(cat token.txt)"
clawgate --mode agent
clawgate --mode resource --connect <agent-ip>:53280
Steps 1โ3 are one-time setup. After that, just create new tokens anytime. Tokens hot-reload - no restart needed.
15 layers of protection. Assume breach at every layer.
| Layer | Protection |
|---|---|
| Transport | X25519 + XChaCha20-Poly1305 end-to-end encryption |
| Forward Secrecy | Fresh ephemeral keys per session |
| Authentication | Ed25519 signed JWT capability tokens |
| Authorization | Per-request path and tool scope validation |
| Revocation | Resource-side revocation list, checked every request |
| Path Safety | Canonicalization, symlink rejection, traversal protection |
| Forbidden Paths | ~/.ssh, ~/.aws, ~/.gnupg - hardcoded, ungrantable |
| Git Allowlists | Three-tier command allowlists, blocked flags (-c, --exec) |
| Argument Validation | Per-tool allowlist/denylist for command flags |
| Tool Path Validation | All tool arguments scanned for paths, validated against per-tool scope |
| No Shell Execution | Tools run via direct argv, no shell interpolation |
| Output Limits | Per-tool configurable output truncation |
| Symlink Rejection | All symlinks unconditionally rejected |
| Time Limits | Tokens expire, limiting blast radius |
| Audit Trail | Every operation logged locally with cryptographic proof |
Register any CLI tool. The agent invokes it remotely with argument validation and output limits.
Three permission tiers: read-only, write, full. Command allowlists block dangerous flags.
Revoke tokens before they expire. Resource-side enforcement - the agent doesn't need to be contacted.
Auto-generates agent-readable skill files from the tool registry. Agents discover tools automatically.
X25519 key exchange + XChaCha20-Poly1305. Forward secrecy per session.
Add tokens while running. No restarts. No reconnects.
Every operation logged to ~/.clawgate/logs/audit.log with full detail.
Single binary. No runtime. No supply chain risk. Minimal latency.
Native MCP server for tool-based agents. Drop-in skill files for CLI agents like OpenClaw.
Skill files for CLI-based agents. MCP server for tool-based agents.
Skill file (CLI)
Skill file + MCP
MCP server
Skill file + MCP
Skill file + MCP
Telegram conversations with OpenClaw, followed by the CLI operations the agent calls under the hood.
eyJhbGciOiJFZDI1NTE5...src/ docs/ skills/ testing/ scripts/
build.zig README.md LICENSE ...MIT License
Copyright (c) 2026 M64
Permission is hereby granted...$ clawgate grant --read ~/projects/webapp/** --ttl 24h
eyJhbGciOiJFZDI1NTE5IiwidHlwIjoiSldUIn0.eyJpc3MiOi...
$ clawgate cat ~/projects/webapp/src/main.zig const std = @import("std"); const server = @import("server.zig"); pub fn main() !void { var gpa: std.heap.GeneralPurposeAllocator(.{}) = .init; ...
$ clawgate git ~/projects/webapp log --oneline -5 a8e3ba1 Merge pull request #3 from v0.3.0/custom-tools 4b0698d v0.3.0 - custom tools c92a1f8 Add argument validation for tool proxy 7d3e5b2 Implement tool registry with JSON persistence 1a4f9c0 Initial commit
$ clawgate tool register calc \ --command "bc -l" --allow-args "-q" \ --description "Calculator" Tool registered $ clawgate grant --tool calc --ttl 4h eyJhbGciOiJFZDI1NTE5IiwidHlwIjoiSldUIn0.eyJpc3MiOi...
$ echo "scale=2; 22/7" | clawgate tool calc 3.14
eyJhbGciOiJFZDI1NTE5...
~/projects/webapp/**. Expires in 24h.
$ clawgate cat ~/.ssh/id_rsa Error: ACCESS_DENIED: Forbidden path $ clawgate git ~/projects/webapp push origin main Error: SCOPE_VIOLATION: Insufficient git permissions
Stop exposing your machine. Start using capability-based access.