Rampart

September 10, 2026 · View on GitHub

Rampart

Open-source policy and approval control for AI agents.

Rampart — Let agents move fast. Keep the final say.

Go License CI Release Docs

Install · How it works · Integrations · Policies · Documentation


AI agents can edit files, run commands, call APIs, and ship code at machine speed. Harnesses provide their own permissions, sandboxes, and approval modes. Rampart adds operator-owned policies and a consistent audit trail across its supported integration boundaries.

It sits at supported hooks, plugins, proxies, and process boundaries; evaluates the action against local policy; and returns allow, ask, or deny before the host executes it. Decisions are visible, approvals stay human-owned, and the result becomes part of a hash-chained audit trail.

Agent proposes an action


   ┌─────────────┐
   │   Rampart   │  policy · approval · audit
   └──────┬──────┘

      allow / ask / deny


Host executes — or does not

Rampart is a security boundary, not a sandbox. It sees actions exposed by the configured integration; it does not see arbitrary syscalls or network traffic inside a process you already allowed. Start with the threat model when deciding where to rely on it.

Install

brew install peg/tap/rampart

rampart protect
rampart verify --all
rampart watch

That is the normal path:

  1. protect detects supported installed agents and configures their managed boundaries.
  2. verify --all runs fixed, non-executing canaries without invoking a model.
  3. watch shows decisions as they happen.
Other installation methods

macOS and Linux installer

curl -fsSL https://rampart.sh/install | bash

Windows PowerShell

irm https://rampart.sh/install.ps1 | iex

Go

go install github.com/peg/rampart/cmd/rampart@latest

Source builds require Go 1.26.8 or newer. Windows upgrades use the PowerShell installer; binary self-upgrade is intentionally disabled there.

Why Rampart

What you get
Policy before executionMatch shell, file, network, MCP, messaging, and other host-exposed actions before they run.
Selective approvalRoutine work stays quiet. Sensitive actions can use the host's native approval UI where the integration supports it.
Fail-closed ownershipWhen Rampart owns a decision and cannot safely classify or persist it, the action does not silently proceed.
Auditable evidenceInspect live decisions, verify installed boundaries, and validate a hash-chained local audit trail.
Local and model-free by defaultThe policy engine is a Go binary. Core enforcement and verification do not require an LLM or provider traffic.

How it works

Rampart architecture

Every integration has a concrete observation boundary. Rampart normalizes the action visible there. When a supported adapter receives multiple represented targets, it evaluates each one and lets the most restrictive decision win.

ALLOW  exec  npm test                         [allow-dev]
DENY   read  ~/.ssh/id_ed25519                [block-credentials]
ASK    exec  kubectl apply -f production.yaml [approve-production]
DENY   resp  tool output contained a secret   [scan-response]

rampart status separates configuration from evidence:

  • HOST VERIFIED means an active safe verifier reached the installed host boundary.
  • ADAPTER VERIFIED means Rampart proved its installed configuration and adapter behavior, not authenticated host ingestion.
  • Experimental and static-only integrations stay labeled as such.

Verification receipts contain outcomes and fingerprints—not prompts, commands, credentials, host output, or agent memory.

Integrations

IntegrationBoundaryCurrent assurance
OpenClawNative before_tool_call pluginLive host verifier; managed fail-closed defaults and native approval cards
Claude CodeNative pre/post tool hooksInstalled configuration and adapter verification
CodexUser-level lifecycle hooks for CLI, IDE, and desktopInstalled configuration and adapter verification
ClineEditor and CLI hook filesPackage startup, hook shape, and adapter tested; host limitations documented
AntigravityShared CLI/IDE PreToolUse pluginInstalled plugin and adapter verification
GitHub CopilotCLI adapter and VS Code Preview hooksPackage/adapter and contract testing; authenticated ingestion pending
CursorLocal Agent and Cmd+K preToolUse hookInstalled fail-closed configuration and adapter verification; Cloud/Tab separate
Hermes AgentExperimental pre_tool_call user pluginCompatible hosts can use native approval; no safe live host verifier yet
Gemini CLIExperimental BeforeTool/AfterTool hooksEnterprise/API-key path; authenticated host proof pending
MCP serversJSON-RPC stdio proxyCorrelated request/response policy and identity enforcement
Other agentsCooperative shell wrapper or compatible process preloadExplicitly limited; prefer a native integration when available
rampart protect openclaw
rampart setup claude-code
rampart setup codex
rampart setup cline
rampart setup antigravity
rampart setup copilot
rampart setup cursor

Experimental integrations are explicit opt-ins and stay outside bare rampart protect auto-detection:

rampart setup hermes
rampart setup gemini

See the support matrix for platform coverage, verifier strength, and known host-owned limitations.

A policy you can read

Rampart policies are YAML, local, and hot-reloaded:

version: "1"
default_action: allow

policies:
  - name: block-credential-reads
    match:
      tool: [read]
    rules:
      - action: deny
        when:
          path_matches:
            - "**/.ssh/id_*"
            - "**/.aws/credentials"
            - "**/.env"
        message: "Credential access blocked"

  - name: approve-production
    match:
      tool: [exec]
    rules:
      - action: ask
        when:
          command_matches:
            - "kubectl apply *"
            - "terraform apply *"
        message: "Production change requires approval"

For common cases, you do not need to edit YAML:

rampart allow "npm install *"
rampart block "curl * | bash"
rampart rules
rampart test "rm -rf /"

Project-specific policy can live with the code:

rampart init --project

That creates .rampart/policy.yaml. Set RAMPART_NO_PROJECT_POLICY=1 when working in a repository whose policy you do not trust.

Policy guide → · Policy schema → · Community policies →

Approvals without prompt fatigue

An ask rule requires human review of the action that matched. The integration determines where that review appears and whether it can resume the call. Paths without an approval resolver block the request.

For integrations using Rampart's approval queue, review and resolve requests through its dashboard or CLI:

rampart pending --details
rampart approve <id>
rampart deny <id>

The OpenClaw native plugin offers allow-once and deny in OpenClaw's own UI; those requests do not also appear in Rampart's queue. Persistent allowances require explicit operator policy. Compatible Hermes installations likewise use host-owned approval and resume. Standalone rampart mcp currently blocks ask requests; starting rampart serve does not connect a resolver to that proxy.

See the approval paths and limits before choosing an integration.

Watch, verify, and audit

Rampart live decision view
rampart status
rampart doctor
rampart verify --all
rampart audit tail --follow
rampart audit verify

Audit records are hash-chained and redact common credential shapes before normal persistence and display boundaries. They still contain operational metadata and command structure, so treat the owner-only audit directory as sensitive authorization state.

MCP and non-native agents

Proxy a command-launched MCP server:

rampart mcp -- npx @modelcontextprotocol/server-filesystem /path
rampart init --profile mcp-server

For an agent without native hooks:

rampart wrap -- your-agent
rampart preload -- your-agent

wrap is a cooperative $SHELL boundary and cannot intercept absolute shell paths or direct process APIs. preload covers compatible dynamically linked exec/spawn calls on Linux and non-SIP-protected macOS processes; static, setuid, direct-syscall, and SIP-protected paths remain outside that boundary.

MCP proxy → · Any CLI agent → · Threat model →

Releases

Use the latest stable release and read the changelog for features, fixes, and upgrade notes.

Documentation

Contributing

Focused fixes, integration compatibility work, documentation improvements, and security hardening are welcome. Start with CONTRIBUTING.md.

Please report suspected vulnerabilities privately through SECURITY.md, not a public issue.

Companion project

Snare adds detective controls with canary credentials and paths. Rampart blocks; Snare catches.

License

Apache 2.0