Integrate Clampd in 3 lines. Python, TypeScript, any framework.
1-line integration. The minimal OpenAI example below is here so this tab is self-contained. For Anthropic, LangChain, Google ADK, CrewAI, multi-agent identity, response inspection, streaming, and MCP proxy examples, see /sdk.
โ Full Python SDK reference and 10 more framework examples on /sdk
1-line integration. The minimal OpenAI example below is here so this tab is self-contained. For Anthropic, function wrapping, response inspection, multi-agent identity, streaming, and MCP proxy examples, see /sdk.
โ Full TypeScript SDK reference and 8 more examples on /sdk
A standalone CLI for managing your Clampd cluster from the terminal. Inspect agents, trigger kills, import policies, stream audit logs, run compliance reports, and monitor everything with a live TUI dashboard.
Download now: Pre-built binaries for Linux (x86_64, ARM64) and Windows available on the Setup page. macOS: build from source with cargo install.
| Command | Description |
|---|---|
clampd agent list | List all registered agents with state and risk |
clampd kill <agent-id> | Emergency kill switch |
clampd policy list | Show active policies |
clampd watch | Live TUI dashboard - real-time monitoring |
clampd demo | Run live demo with real threat detection |
Manage multiple environments with named contexts - like kubectl config. Each context stores an endpoint, org ID, and credentials. Switch instantly between local, staging, and production.
Stored at ~/.clampd/config.toml. Contexts replace the old flat config - existing configs auto-migrate.
A standalone binary that hooks into Claude Code and Cursor as a PreToolUse/PostToolUse guard. Every tool call is verified against your Clampd gateway before execution. 3.2MB binary, <100ms per check.
What it does:
/etc/clampd/guard.json via MDMA multi-stage runtime security layer sits between your agents and their tools. Every tool call is authenticated, classified, policy-checked, and audited.
Interactive API documentation is available at your Dashboard API:
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ LLM / Agent โโโโโโถโ Clampd Security Pipeline โโโโโโถโ Your Tool โ โ (LangChain, โ โ โ โ (DB, API, โ โ ADK, MCP) โโโโโโโ Authenticate โ Classify โ Evaluate โ Audit โโโโโโโ File, MCP) โ โโโโโโโโโโโโโโโโโโโ โ <25ms p95 latency โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Inside ag-intent, every tool call is evaluated by a five-layer pipeline. Each layer either short-circuits with a verdict or hands a richer feature vector to the next. The output of the last layer feeds the score and decision step that emits Allow, Deny, or Allow-with-token.
The pipeline is intentionally tiered cheap to expensive. Microsecond-level filters run first so that the vast majority of benign traffic never reaches the heavier rule, dictionary, behavioural, or judge stages. Only ambiguous cases climb the stack.
Some layer details are not published. Adversarial resilience benefits from a less-mappable surface, so L0 and L3 internals are deliberately withheld.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Tool call arrives at ag-intent โ
โ inputs: tool descriptor + params + session โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ L0 Fast-path filter โ
โ Pre-filter that rejects clearly-benign calls โ
โ in microseconds. Implementation details โ
โ proprietary. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ L1 Rule engine โ
โ 264 detection rules across 12 categories. โ
โ See /products for the public rule list. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ L2 Dictionary scan โ
โ Token-level scan against malicious-phrase and โ
โ soft-injection dictionaries. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ L3 Behavioural signals [PROPRIETARY] โ
โ Session correlation across 16 patterns, โ
โ cross-agent flags, anomaly detectors. โ
โ Internals withheld for adversarial resilience. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ L4 Normalize + LLM-as-Judge (escalation) โ
โ Encoding pipeline plus judge invocation when โ
โ signals are ambiguous. Public thresholds: โ
โ low 0.2 / high 0.75. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Score and decision โ
โ Allow ยท Deny ยท Allow-with-token โ
โ Typically 12.3 ms p50 end-to-end. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
For per-rule details see the rules reference below. For scoring math, see the source under BSL-1.1.
Actual log output from Docker. See exactly what happens when a request flows through the proxy.
The 264 detection rules across 12 categories cover destructive SQL, credential access, SSRF and cloud metadata probing, injection attacks (SQL, NoSQL, LDAP, SSTI), prompt injection, PII exfiltration, shell exploits, XSS / path traversal, and more. Region-specific PII detection covers 20 languages including Aadhaar, PAN, NRIC, and other locale identifiers. Risk thresholds are configurable. For the full rule catalogue with examples and risk levels, see /features and /products.
Every event is recorded. Query your audit trail with standard SQL.
| tool_name | blocked | assessed_risk | denial_reason |
|---|---|---|---|
| database.query | true | high | destructive SQL |
| database.query | false | low | |
| file.read | true | high | path traversal |
| file.read | false | low | |
| http.fetch | true | high | SSRF detected |
| http.fetch | false | low | |
| shell.exec | true | critical | dangerous command |
| shell.exec | false | low |
Hosted at app.clampd.dev with no infrastructure to manage. Self-hosted via Docker Compose for the full 9-service pipeline. Kubernetes / Helm charts coming soon. Air-gapped install supported after one-time license activation. For complete install steps, license activation, compose file links, and air-gapped notes, see /setup.
ag-gateway exposes a /metrics endpoint in Prometheus exposition format. Scrape it with any Prometheus-compatible tool.
When Clampd approves a tool call, it mints a short-lived, single-use micro-token and forwards it to your tool service via the Authorization: Bearer <token> header. Your tool service should validate this token before executing any action.
| Property | Description |
|---|---|
sub | Agent ID that initiated the tool call |
scope | Space-separated list of scopes the agent is allowed (e.g. db:read) |
exp | Expiry timestamp - tokens expire in 30 seconds |
jti | Unique token ID - each token can only be used once |
ag:tool_binding | Hash binding the token to a specific tool descriptor |
ag:session_id | Session ID (optional) for correlating calls within a session |
ag:trust_level | Trust level (optional) - present when operating in degraded mode |
The recommended approach is to call the Clampd Introspect endpoint, which verifies the signature, checks expiry, enforces single-use, and confirms the agent is not on the deny list - all in one call.
| Field | Type | Description |
|---|---|---|
active | boolean | true if the token is valid and consumable |
sub | string | Agent ID |
scope | string | Space-separated scopes |
exp | integer | Expiry (Unix timestamp) |
tool_binding | string | Tool descriptor binding hash |
reason | string? | Why the token was rejected (only when active is false) |
Tokens are single-use: once introspected, the nonce is consumed and the same token cannot be used again. If your tool service does not call Introspect, the token expires automatically after 30 seconds.
Validate your Clampd deployment with built-in testing tools, external red team frameworks, and community payload lists. Run attacks against your own cluster to verify every rule fires correctly.
The clampd test CLI command fires a suite of attack payloads against your gateway and reports which were blocked, flagged, or allowed.
| Flag | Description |
|---|---|
--gateway <url> | Gateway URL (default: http://localhost:8080) |
--attacks <category|all> | Attack categories to run: sqli, xss, ssrf, shell, traversal, injection, or all |
--json | Output results as JSON (for CI pipelines) |
--watch | Continuous mode. Re-run tests on an interval |
--interval <seconds> | Interval between watch runs (default: 60) |
--exit-on-fail | Exit with non-zero code if any attack is not blocked (CI gate) |
You can also use the Red Team Live tab in the Playground to run attacks interactively from the browser.
Clampd endpoints are standard HTTP. Any security testing tool that can send POST requests can target them. Below are well-known frameworks and payload sources that work out of the box.
| Tool | Install | What It Tests | Clampd Endpoint |
|---|---|---|---|
| Promptfoo | npm i -g promptfoo | 80+ attack plugins, encoding evasion | /v1/proxy, /v1/scan-input |
| Garak (NVIDIA) | pip install garak | Encoding probes, jailbreaks, DAN attacks | /v1/scan-input |
| PyRIT (Microsoft) | pip install pyrit | Multi-step attack chains, red teaming | /v1/proxy |
| SecLists | github.com/danielmiessler/SecLists | 1000+ SQLi, XSS, LFI payloads | /v1/scan-input |
| PayloadBox | github.com/payloadbox | Categorized injection payloads | /v1/scan-input |
Save this as promptfooconfig.yaml and run promptfoo redteam run to fire 50 adversarial probes at your gateway.
Garak uses a REST generator to target any HTTP endpoint. Save as garak-clampd.yaml and run garak --model_type rest --model_name clampd --config garak-clampd.yaml.
A minimal bash script to fire payload lists (SecLists, PayloadBox, or your own) at Clampd and report which payloads were not blocked.