APort Agent Guardrails
APort Agent Guardrails is a deterministic pre-action authorization tool for AI agents. It verifies each tool call against a passport and policy before execution, preventing prompt injection from bypassing policy checks. It is for developers building or deploying AI agents across frameworks like OpenClaw, Cursor, Claude Code, LangChain, CrewAI, and DeerFlow.
✨ Key features
- Deterministic enforcement via runtime hook, not prompt instructions
- Fail-closed defaults: verification failures block risky actions
- Auditable decisions: each allow/deny logged with context
- Open standard artifacts: Open Agent Passport (OAP) v1.0 formats
- Low latency: cloud API verification p50 ~53ms at N=1,000
- Supports multiple frameworks: OpenClaw, Cursor, Claude Code, LangChain, CrewAI, DeerFlow
🎯 Use cases
- Protect AI agents from prompt injection attacks
- Enforce security policies on tool calls in agent frameworks
- Audit agent actions for compliance and security review
- Deploy enterprise-wide guardrails for AI agent fleets
📦 Installation
🧰 Requirements: Node 18+ for the setup wizard; jq needed for local/bash guardrail; Python CLI available via uvx or pip; no API key required for local mode, but hosted mode may require an account.
npx @aporthq/aport-agent-guardrails
Choose your framework: openclaw, cursor, claude-code, langchain, crewai, deerflow, n8n.
For Claude Code direct: npx @aporthq/aport-agent-guardrails claude-code
Curl install: curl -fsSL https://aport.io/install.sh | bash -s -- claude-code
For Python frameworks (LangChain/CrewAI/DeerFlow):
uvx --from aport-agent-guardrails aport setup --framework=langchain
# or --framework=crewai / deerflow
Or install package: pip install aport-agent-guardrails then aport setup --framework=langchain
🚀 Usage
aport-guardrail system.command.execute '{"command":"ls"}' # ALLOW (safe)
aport-guardrail system.command.execute '{"command":"rm -rf /"}' # DENY (blocked pattern)
# Exit: 0 = ALLOW, 1 = DENY
If using npx without -g, run npx aport-guardrail ....
⚠️ Good to know
n8n and VoltAgent integrations are in progress or coming soon; Python CLI does not parse API/local mode flags yet.
❓ FAQ
How does APort prevent prompt injection?
It runs deterministic pre-action authorization before tool execution, so prompt injection cannot bypass policy checks.
What frameworks are supported?
OpenClaw, Cursor, Claude Code, LangChain, CrewAI, DeerFlow, and n8n (coming soon).
What are the installation requirements?
Node 18+ for the setup wizard; jq is needed for local/bash guardrail; Python CLI available via uvx or pip.
How do I test the guardrail?
Use the aport-guardrail command (Node) or call the evaluator from Python; exit code 0 means ALLOW, 1 means DENY.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.