{"name":"APort Agent Guardrails: Deterministic Pre-Action Authorization for AI Agents","description":"APort Agent Guardrails provides deterministic pre-action authorization for AI agents, running security checks before any tool execution. This crucial mechanism prevents prompt injection from bypassing policy, ensuring robust and auditable protection for AI-driven operations.","github":"https://github.com/aporthq/aport-agent-guardrails","url":"https://osrepos.com/repo/aporthq-aport-agent-guardrails","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/aporthq-aport-agent-guardrails","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/aporthq-aport-agent-guardrails.md","json":"https://osrepos.com/repo/aporthq-aport-agent-guardrails.json","topics":["ai","ai-agent-governance","guardrails","security","authorization","shell","agent-security"],"keywords":["ai","ai-agent-governance","guardrails","security","authorization","shell","agent-security"],"stars":null,"summary":"APort Agent Guardrails provides deterministic pre-action authorization for AI agents, running security checks before any tool execution. This crucial mechanism prevents prompt injection from bypassing policy, ensuring robust and auditable protection for AI-driven operations.","content":"## Introduction\nAPort Agent Guardrails is an open-source repository providing deterministic pre-action authorization for AI agents. It ensures that security guardrails are executed before any tool, command, or action is performed by an AI agent. This crucial design prevents prompt injection attacks from bypassing established policy checks, offering a robust layer of security for AI-driven systems.\n\n## Why Use and Benefits\nSecuring AI agents is paramount, and APort Agent Guardrails offers several compelling advantages for developers and teams:\n\n*   **Deterministic Enforcement:** Guardrails operate via runtime hooks, not just prompt instructions, ensuring actions are verified before execution.\n*   **Fail-Closed Defaults:** Verification failures automatically block risky actions, providing a secure-by-default posture.\n*   **Explicit Rollout Mode:** Use `--enforcement=warn` to record deny decisions while allowing actions during policy tuning, enabling safe rollout.\n*   **Auditable Decisions:** Every allow or deny decision is logged with context, providing a clear audit trail.\n*   **Open Standard Artifacts:** Utilizes Open Agent Passport (OAP) v1.0 passport and decision formats for transparency.\n*   **Research-Backed Outcomes:** Proven effectiveness in adversarial testbeds, demonstrating 0% successful breaches under restrictive OAP policy against top-tier attempts.\n*   **Low Latency at Production Scale:** Cloud API verification boasts p50 ~53ms at N=1,000, ensuring minimal performance impact.\n*   **Comprehensive Security Documentation:** Detailed `SECURITY.md` and `SECURITY_MODEL.md` provide insights into the project's security posture.\n\n## Installation\nGetting started with APort Agent Guardrails is straightforward, whether you're protecting a GitHub repository or integrating runtime guardrails into your AI agent framework.\n\n**Protect a GitHub Repository:**\nTo protect your GitHub repository in 60 seconds, run:\nbash\nnpx @aporthq/aport-agent-guardrails github\n\nFor blocking hosted enforcement on protected branches, use:\nbash\nnpx @aporthq/aport-agent-guardrails github --mode hosted --branches main,staging\n\n\n**Install Runtime Guardrails:**\nFor runtime hooks, you can use the interactive installer or specify your framework:\nbash\nnpx @aporthq/aport-agent-guardrails\n# or for a specific framework, e.g., Claude Code\nnpx @aporthq/aport-agent-guardrails claude-code\n\nFor Python users (e.g., LangChain, CrewAI, DeerFlow), first run the Node CLI for setup, then install the Python package:\nbash\nuvx --from aport-agent-guardrails aport setup --framework=langchain\n# or\npip install aport-agent-guardrails\naport setup --framework=langchain\n\nFollow the printed instructions to install framework-specific Python packages and wire the provider/callback.\n\n## Examples\nAfter installation, APort Agent Guardrails automatically runs when your agent uses tools. You can also test policy decisions directly from the command line.\n\n**Test Policy from CLI (Node):**\nbash\naport-guardrail system.command.execute '{\"command\":\"ls\"}'      # ALLOW (safe)\naport-guardrail system.command.execute '{\"command\":\"rm -rf /\"}'  # DENY (blocked pattern)\n\nThe exit code indicates the decision: `0` for ALLOW, `1` for DENY.\n\n**Check Passport Status and Audit:**\n*   **Passport & Audit:** Stored in your APort framework state directory (e.g., `~/.cursor/aport/`, `~/.aport/langchain/aport/`).\n*   **Audit Log:** `config_dir/aport/audit.log` contains one line per decision.\n*   **Last Decision:** `config_dir/aport/decision.json` holds the latest OAP v1.0 format decision.\n\n## Links\nFor more detailed information, documentation, and community engagement, refer to the following official links:\n\n*   [npm package](https://www.npmjs.com/package/@aporthq/aport-agent-guardrails)\n*   [APort Website](https://aport.io)\n*   [Official Documentation](https://aport.io/docs)\n*   [GitHub Issues](https://github.com/aporthq/aport-agent-guardrails/issues)\n*   [GitHub Discussions](https://github.com/aporthq/aport-agent-guardrails/discussions)","metrics":{"detailViews":1,"githubClicks":0},"dates":{"published":null,"modified":"2026-09-19T20:46:51.000Z"}}