agentmon

module
v0.0.0-...-230ac96 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0

README

agentmon

macOS note: Native macOS enforcement via ESF (Endpoint Security Framework) + NE (Network Extension) is in Alpha. File, command and network policy are enforced and verified on real hardware; DNS policy and resource limits are not enforced at all. Expect rough edges and breaking changes. Apple Silicon only.

Windows is not supported. It was removed in full, rather than being unfinished.

Secure, policy-enforced execution gateway for AI agents.

agentmon sits under your agent/tooling—intercepting file, network, process, and signal activity (including subprocess trees), enforcing the policy you define, and emitting structured audit events.

Platform note: Linux and macOS only. Scores come from agentmon detect, which probes the machine it runs on — macOS with the system extension and content filter active measures 85/100 (file, command, network and seatbelt isolation enforced; resource limits and DNS absent). Linux's score depends on which kernel features the host offers, so run the command rather than assuming one. See the Platform Comparison for what enforces and what does not.


What is agentmon?

  • Drop-in shell/exec endpoint that turns every command (and its subprocesses) into auditable events.
  • Per-operation policy engine: allow, deny, approve (human OK), soft_delete, or redirect.
  • Full I/O visibility:
    • file open/read/write/delete
    • network connect + DNS
    • process start/exit
    • PTY activity
    • LLM API requests with DLP and usage tracking
    • Postgres-family database traffic through declared db_services
    • signal send/block (enforced on Linux and macOS)
    • database queries via the embedded PostgreSQL proxy — per-statement classification and policy
    • Route outbound HTTP API calls through declared services (http_services) with per-method, per-path rules, approval gating, and fail-closed host enforcement
  • Two output modes:
    • human-friendly shell output
    • compact JSON responses for agents/tools

Why agentmon?

Agent workflows eventually run arbitrary code (pip install, make test, python script.py). Traditional "ask for approval before running a command" controls stop at the tool boundary and can't see what happens inside that command.

agentmon enforces policy at runtime, so hidden work done by subprocesses is still governed, logged, and (when required) approved.


Meaningful blocks: deny → redirect (the "steering" superpower)

Most systems can deny an action. agentmon can also redirect it.

That means when an agent tries the wrong approach (or brute-force workarounds), policy can steer it to the right path by swapping the command and returning guidance—keeping the agent on the paved road and reducing wasted retries.

Example: redirect curl to an audited wrapper

command_rules:
  - name: redirect-curl
    commands: [curl, wget]
    decision: redirect
    message: "Downloads routed through audited fetch"
    redirect_to:
      command: agentmon-fetch
      args: ["--audit"]

Example: redirect writes outside workspace back inside

file_rules:
  - name: redirect-outside-writes
    paths: ["/home/**", "/tmp/**"]
    operations: [write, create]
    decision: redirect
    redirect_to: "/workspace/.scratch"
    message: "Writes outside workspace redirected to /workspace/.scratch"

The agent sees a successful operation (not an error), but you control where things actually land.


Containers + agentmon: better together

Containers isolate the host surface; agentmon adds in-container runtime visibility and policy.

  • Per-operation audit (files, network, commands) shows what happened during installs/builds/tests.
  • Approvals and rules persist across long-lived shells and subprocess trees—not just the first command.
  • Path-level controls on mounted workspaces/caches/creds; containers don't natively give that granularity.
  • Same behavior on host and in containers, so CI and local dev see the same policy outcomes.

Quick start

Install

There is no published release yet, and no Homebrew tap. Build from source.

Linux

make build
sudo install -m 0755 bin/agentmon bin/agentmon-shell-shim /usr/local/bin

macOS (Apple Silicon only, Xcode 15+)

SIGNING_IDENTITY="Developer ID Application: ..." make build-macos-enterprise

The system extension will not load unless the bundle is signed and notarized: System Integrity Protection blocks systemextensionsctl developer on, so notarization is the only route. Then:

/Applications/AgentMon.app/Contents/MacOS/agentmon activate-extension

Approve the extension in System Settings > General > Login Items & Extensions, and grant it Full Disk Access — without that, Endpoint Security cannot start and the extension crash-loops. agentmon detect reports what is actually active.

See macOS Build Guide for the full sequence.


Run locally
# Start the server (optional if using autostart)
./bin/agentmon server --config configs/server-config.yaml

# Create a session and run a command (shell output)
SID=$(./bin/agentmon session create --workspace . --json | jq -r .id)
./bin/agentmon exec "$SID" -- ls -la

# Structured output for agents
./bin/agentmon exec --output json --events summary "$SID" -- curl https://example.com

Check what gets enforced

agentmon detect probes the host and reports which enforcement primitives are actually available — seccomp, Landlock, FUSE, eBPF, ptrace, cgroups — grouped into per-domain protection scores plus the selected security mode. On restricted hosts (Daytona, E2B, Firecracker-class) where the seccomp user-notify listener can't install, it reports the mode that will actually enforce rather than what the kernel merely supports.

agentmon detect              # human-readable protection report
agentmon detect config       # emit a config tuned for this host

See Security Modes for the mode matrix and tuning knobs.


Tell your agent to use it (AGENTS.md / CLAUDE.md snippet)
## Shell access

- Run commands via agentmon, not directly in bash/zsh.
- Use: `agentmon exec $SID -- <your-command-here>`
- For structured output: `agentmon exec --output json --events summary $SID -- <your-command-here>`
- Get session ID first: `SID=$(agentmon session create --workspace . --json | jq -r .id)`

Autostart (no manual daemon step)

You do not need to start agentmon server yourself.

  • The first agentmon exec (or any shimmed /bin/sh//bin/bash) will automatically launch a local server using configs/server-config.yaml (or AGENTMON_CONFIG if set).
  • That server keeps the FUSE layer and policy engine alive for the session lifetime; subsequent commands reuse it.
  • Set AGENTMON_NO_AUTO=1 if you want to manage the server lifecycle manually.

Use in Docker (with the shell shim)

See Dockerfile.example for a minimal Debian-based image.

Inside the image, install a release package (or copy your build), then activate the shim:

agentmon shim install-shell \
  --root / \
  --shim /usr/bin/agentmon-shell-shim \
  --bash \
  --i-understand-this-modifies-the-host

Point the shim at your server (sidecar or host):

ENV AGENTMON_SERVER=http://127.0.0.1:18080

Now any /bin/sh -c ... or /bin/bash -lc ... in the container routes through agentmon.

Non-interactive enforcement

By default, the shim bypasses policy when stdin is not a TTY (preserving binary data for piped commands). On platforms where commands are always non-interactive but still need enforcement (e.g., exe.dev, sandbox APIs), add --force:

agentmon shim install-shell \
  --root / \
  --shim /usr/bin/agentmon-shell-shim \
  --bash \
  --force \
  --i-understand-this-modifies-the-host

This writes /etc/agentmon/shim.conf with force=true, which the shim reads at startup. The config file works regardless of how the shell is spawned (unlike env vars or profile scripts). AGENTMON_SHIM_FORCE=1 in the process environment achieves the same effect per-process.

Recommended pattern: run agentmon as a sidecar (or PID 1) in the same pod/service and share a workspace volume; the shim ensures every shell hop stays under policy.


Policy model

Decisions
  • allow
  • deny
  • approve (human OK)
  • redirect (swap a command)
  • audit (allow + log)
  • soft_delete (quarantine deletes with restore)
Scopes
  • file operations
  • commands
  • environment vars
  • network (DNS/connect)
  • database (SQL statements via the PostgreSQL proxy)
  • PTY/session settings
  • declared HTTP services
Evaluation
  • first matching rule wins

Rules live in a named policy; sessions choose a policy.

Defaults:

  • sample config: configs/server-config.yaml
  • default policy: configs/policies/default.yaml
  • env override: set AGENTMON_POLICY_NAME to an allowed policy name (no suffix). If unset/invalid/disallowed, the default is used.
  • env policy: configure policies.env_policy (allow/deny, max_bytes, max_keys, block_iteration) and per-command env_* overrides in policy files. Empty allowlist defaults to minimal PATH/LANG/TERM/HOME with built-in secret deny list; set block_iteration to hide env iteration (requires env shim).
  • allowlist: configure policies.allowed in config.yml; empty means only the default is permitted.
  • optional integrity: set policies.manifest_path to a SHA256 manifest to verify policy files at load time.
Environment policy quick reference
  • Defaults: With no env_allow, agentmon builds a minimal env (PATH/LANG/TERM/HOME) and strips built-in secret keys.
  • Overrides: Per-command env_allow/env_deny plus env_max_keys/env_max_bytes cap and filter the child env at exec time.
  • Block iteration: env_block_iteration: true (global or per rule) hides env enumeration; set policies.env_shim_path to libenvshim.so so agentmon injects LD_PRELOAD + AGENTMON_ENV_BLOCK_ITERATION=1.
  • Limits: Errors if limits are exceeded; env builder is applied before exec for every command.
  • env_inject: Operator-trusted environment variables injected into all commands, bypassing policy filtering. Primary use: BASH_ENV to disable shell builtins that bypass seccomp. Configure in sandbox.env_inject (global) or policy-level env_inject (overrides global).
  • Examples: See config.yml and policy samples under configs/.

Example rules (trimmed)
version: 1
name: default

file_rules:
  - name: allow-workspace
    paths: ["/workspace", "/workspace/**"]
    operations: [read, open, stat, list, write, create, mkdir, chmod, rename]
    decision: allow

  - name: approve-workspace-delete
    paths: ["/workspace", "/workspace/**"]
    operations: [delete, rmdir]
    decision: approve
    message: "Delete {{.Path}}?"
    timeout: 5m

  - name: deny-ssh-keys
    paths: ["/home/**/.ssh/**", "/root/.ssh/**"]
    operations: ["*"]
    decision: deny

network_rules:
  - name: allow-api
    domains: ["api.example.com"]
    ports: [443]
    decision: allow

command_rules:
  - name: block-dangerous
    commands: ["rm", "shutdown", "reboot"]
    decision: deny

Using a policy
# Start the server with your policy
./bin/agentmon server --config configs/server-config.yaml

# Create a session pinned to a policy
SID=$(./bin/agentmon session create --workspace /workspace --policy default --json | jq -r .id)

# Exec commands; responses include decision + guidance when blocked/approved
./bin/agentmon exec "$SID" -- rm -rf /workspace/tmp
Authentication

agentmon supports multiple authentication methods:

Type Use Case
api_key Simple deployments with static keys
oidc Enterprise SSO (Okta, Azure AD, etc.)
hybrid Both methods accepted

Approval modes for human-in-the-loop verification:

  • local_tty - Terminal prompt (default)
  • totp - Authenticator app codes
  • webauthn - Hardware security keys (YubiKey)
  • api - Remote approval via REST

See SECURITY.md for configuration details.

MCP Security
  • Tool Whitelisting: Control which MCP tools can be invoked via allowlist/denylist policies
  • Version Pinning: Detect tool definition changes (rug pull protection) with configurable responses
  • Cross-Server Detection: Block data exfiltration patterns (read from Server A → send via Server B)
  • Rate Limiting: Token bucket rate limiting for MCP servers and network domains

See SECURITY.md for full configuration options, or run the MCP Protection Demo to see these detections in action.


60-second demo

The fastest way to "get it" is to run something that spawns subprocesses and touches the filesystem/network.

# 1) Create a session in your repo/workspace
SID=$(agentmon session create --workspace . --json | jq -r .id)

# 2) Run something simple (human-friendly output)
agentmon exec "$SID" -- uname -a
# → prints system info, just like normal

# 3) Run something that hits the network (JSON output + event summary)
agentmon exec --output json --events summary "$SID" -- curl -s https://example.com
# → JSON response includes: exit_code, stdout, and events[] showing dns_query + net_connect

# 4) Trigger a policy decision - try to delete something
agentmon exec "$SID" -- rm -rf ./tmp
# → With default policy: prompts for approval or denies based on your rules

# 5) See what happened (structured audit trail)
agentmon exec --output json --events all "$SID" -- ls
# → events[] shows every file operation, even from subprocesses

What you'll see in the JSON output:

  • exit_code: the command's exit status
  • stdout / stderr: captured output
  • events[]: every file/network/process operation with policy decisions
  • policy.decision: allow, deny, approve, or redirect

Tip: keep a terminal with --output json open when testing policies—it makes it obvious what's being touched.


Session Reports

Generate markdown reports summarizing session activity:

# Quick summary
agentmon report latest --level=summary

# Detailed investigation
agentmon report <session-id> --level=detailed --output=report.md

Reports include:

  • Decision summary (allowed, blocked, redirected)
  • Automatic findings detection (violations, anomalies)
  • Activity breakdown by category
  • Full event timeline (detailed mode)

See CI/CD Integration Guide for pipeline examples.


Workspace Checkpoints

Create snapshots of workspace state for recovery from destructive operations:

# Create a checkpoint before risky operations
agentmon checkpoint create --session $SID --workspace /workspace --reason "before cleanup"

# List checkpoints for a session
agentmon checkpoint list --session $SID

# Show what changed since a checkpoint
agentmon checkpoint show <cp-id> --session $SID --workspace /workspace --diff

# Preview what rollback would restore (dry-run)
agentmon checkpoint rollback <cp-id> --session $SID --workspace /workspace --dry-run

# Restore workspace to checkpoint state
agentmon checkpoint rollback <cp-id> --session $SID --workspace /workspace

# Clean up old checkpoints
agentmon checkpoint purge --session $SID --older-than 24h --keep 5

Auto-checkpoint: When enabled, agentmon automatically creates checkpoints before risky commands (rm, mv, git reset, git checkout, etc.). Configure in sessions.checkpoints.auto_checkpoint.

See SECURITY.md for full configuration options.


LLM Proxy and DLP

agentmon includes an embedded proxy that intercepts all LLM API requests from agents:

# Check proxy status for a session
agentmon proxy status <session-id>

# View LLM-specific events
agentmon session logs <session-id> --type=llm

Features:

  • Automatic routing: Sets ANTHROPIC_BASE_URL and OPENAI_BASE_URL so agent SDKs route through the proxy
  • Custom providers: Route to LiteLLM, Azure OpenAI, vLLM, or corporate gateways
  • DLP redaction: PII (emails, phone numbers, API keys, etc.) is redacted before reaching LLM providers
  • Custom patterns: Define organization-specific patterns for sensitive data
  • Usage tracking: Token counts extracted and logged for cost attribution
  • Audit trail: All requests/responses logged to session storage

Provider configuration:

proxy:
  mode: embedded
  providers:
    anthropic: https://api.anthropic.com    # Default Anthropic API
    openai: https://api.openai.com          # Default OpenAI API

    # Or use alternative providers:
    # openai: http://localhost:8000         # LiteLLM / vLLM
    # openai: https://your-resource.openai.azure.com  # Azure OpenAI
    # anthropic: https://llm.corp.example.com         # Corporate gateway

DLP configuration:

dlp:
  mode: redact
  patterns:
    email: true
    api_keys: true
  custom_patterns:
    - name: customer_id
      display: identifier
      regex: "CUST-[0-9]{8}"

See LLM Proxy Documentation for full configuration options.

The same proxy also dispatches declared http_services entries — named API upstreams with per-method, per-path rules. See Declared HTTP Services and the HTTP Services Cookbook for details.


Database Access Control (Postgres only today)

agentmon can enforce policy on declared database services through db_services, database_connection_rules, and database_rules. The current implementation is Postgres-family only: PostgreSQL is the supported target, with Aurora Postgres using the same path and Redshift/CockroachDB treated as Postgres-compatible dialects with beta coverage. MySQL, MongoDB, Snowflake, BigQuery, Databricks, ClickHouse, MSSQL, Cassandra, Redis, and Oracle are roadmap items, not current runtime support.

Current Postgres support includes:

  • Connection allow/deny/approve/audit decisions.
  • Statement classification for PostgreSQL wire protocol v3, including Simple Query, Extended Query, SQL prepared statements, COPY, FunctionCall denial, transaction state, and CancelRequest mapping.
  • Strict per-object policy coverage with deny precedence.
  • Catalog-backed relation/function selectors for resolved-object policies.
  • Safe runtime redirect for read-only Postgres relation replacement.
  • Bypass detection and real-Postgres Docker E2E coverage in CI.

The Postgres proxy runtime is Linux-only in-process code today. Use native Linux, WSL2, or a Linux VM environment for database enforcement.

See Database Access Control and Policy documentation.


Policy Generation

Generate restrictive policies from observed session behavior ("profile-then-lock" workflow):

# Generate policy from latest session
agentmon policy generate latest --output=ci-policy.yaml

# Generate with custom name and threshold
agentmon policy generate abc123 --name=production-build --threshold=10

# Quick preview to stdout
agentmon policy generate latest

The generated policy:

  • Allows only operations observed during the session
  • Groups paths into globs when many files in same directory
  • Collapses subdomains into wildcards (e.g., *.github.com)
  • Flags risky commands (curl, wget, rm) with arg patterns
  • Includes blocked operations as commented-out rules for review

Use cases:

  • CI/CD lockdown: Profile a build/test run, lock future runs to that behavior
  • Agent sandboxing: Let an AI agent run a task, generate policy for future runs
  • Container profiling: Profile a workload, generate minimal policy for production

Database Access (PostgreSQL)

agentmon includes an embedded PostgreSQL proxy that makes database access agent-aware and policy-governed. It speaks the Postgres wire protocol, classifies every statement into a list of effects (reads, writes, DDL, DCL, transaction/session control, bulk COPY/export, …), and evaluates each effect against database_rules before forwarding upstream — so an UPDATE, DROP, or unscoped DELETE is governed the same way a file write or network connect is.

  • Per-effect, multi-object evaluation — rules are collect-all / any-deny-wins (the most-restrictive verb decides), not first-match.
  • Decisions: allow, deny, approve (human OK), audit, and statement-level redirect.
  • require_where guard — refuse top-level UPDATE/DELETE that lack a WHERE clause.
  • Connection-level rules (database_connection_rules) gate which sessions may reach which declared db_service.
  • Auth + statement audit events for every connection and query; statement-text logging is configurable (policies.db.log_statements: none | parameters_redacted | full).

Phase 1 covers the PostgreSQL v3 wire protocol (dialects: postgres, aurora_postgres; redshift / cockroachdb in beta). Replication and GSSAPI-encrypted connections default-deny.

database_rules:
  # normal reads + updates on the declared service
  - name: app-read-and-update
    db_service: appdb
    operations: [READ, UPDATE]
    decision: allow

  # allow UPDATE/DELETE only when scoped by a WHERE clause
  - name: app-guard-unscoped-dml
    db_service: appdb
    operations: [UPDATE, DELETE]
    require_where: true
    decision: allow

  # block schema/DDL mutations; terminate the transaction on violation
  - name: app-deny-ddl
    db_service: appdb
    operations: [CREATE, DROP, ALTER, EXPORT]
    decision: deny
    deny_mode_in_tx: terminate
    message: "appdb is read+update only. Requested: {{.Operation}}"

See the Database Access Control spec for the full operation taxonomy, effects model, connection rules, and unavoidability threat model.


Network Redirect

agentmon can transparently redirect DNS and TCP connections, enabling use cases like routing API calls through corporate proxies or switching AI providers without code changes.

DNS Redirect

Intercept DNS resolution and return configured IP addresses:

dns_redirect:
  - match: "api.anthropic.com"
    redirect_ip: "10.0.0.50"
    visibility: audit_only
    on_failure: fail_closed

  - match: ".*\\.openai\\.com"    # Regex pattern
    redirect_ip: "10.0.0.51"
    visibility: warn
Connect Redirect

Redirect TCP connections to different destinations with optional TLS handling:

connect_redirect:
  - match: "api.anthropic.com:443"
    redirect_to: "vertex-proxy.internal:8443"
    tls_mode: passthrough          # Forward encrypted traffic unchanged
    visibility: silent

  - match: "api.openai.com:443"
    redirect_to: "azure-proxy.internal:443"
    tls_mode: rewrite_sni          # Modify SNI in TLS ClientHello
    rewrite_sni: "azure-openai.example.com"
    visibility: audit_only
Options
Field Values Description
visibility silent, audit_only, warn How redirects are logged/shown
on_failure fail_closed, fail_open, retry_original What happens if redirect fails
tls_mode passthrough, rewrite_sni TLS handling for connect redirect
Platform Support
Feature Linux macOS
DNS Redirect ✅ eBPF ❌ no transparent redirect
Connect Redirect ✅ eBPF ⚠️ proxy only
SNI Rewrite ✅ ⚠️ proxy only

macOS has no transparent network redirect. internal/platform/darwin/network.go writes pf rules but has no callers — platform.Platform.Network() is never invoked on any platform — so nothing installs them. Redirects on macOS apply only to traffic that goes through agentmon's own proxy, which means the agent has to honour the proxy environment variables. Traffic that ignores them is not redirected.

Use Cases
  • API Gateway Routing: Route Anthropic/OpenAI calls through corporate LLM gateway
  • Provider Switching: Redirect Claude API to GCP Vertex AI or Azure OpenAI
  • Testing: Redirect production APIs to mock servers
  • Compliance: Force all LLM traffic through audit proxies

Signal Filtering

agentmon intercepts signals (kill, SIGTERM, etc.) sent between processes, providing policy-based control over which signals can reach which targets.

Platform Support
Platform Blocking Redirect Audit
Linux Yes (seccomp user-notify) Yes Yes
macOS No No Yes (ES)
Example Signal Rules
signal_rules:
  # Allow signals to self and children
  - name: allow-self
    signals: ["@all"]
    target:
      type: self
    decision: allow

  - name: allow-children
    signals: ["@all"]
    target:
      type: children
    decision: allow

  # Redirect SIGKILL to graceful SIGTERM
  - name: graceful-kill
    signals: ["SIGKILL"]
    target:
      type: children
    decision: redirect
    redirect_to: SIGTERM

  # Block fatal signals to external processes
  - name: deny-external-fatal
    signals: ["@fatal"]
    target:
      type: external
    decision: deny
Signal Groups
  • @all - All signals (1-31)
  • @fatal - SIGKILL, SIGTERM, SIGQUIT, SIGABRT
  • @job - SIGSTOP, SIGCONT, SIGTSTP, SIGTTIN, SIGTTOU
  • @reload - SIGHUP, SIGUSR1, SIGUSR2
Target Types
  • self - Process signaling itself
  • children - Direct child processes
  • descendants - All descendant processes
  • session - Any process in the agentmon session
  • external - PIDs outside the session
  • system - PID 1 and kernel threads

See Policy Documentation for full configuration options.


macOS File I/O Monitoring

On macOS, agentmon monitors file I/O using the Endpoint Security Framework (ESF), subscribing to both AUTH and NOTIFY events. Tracked operations include file open, create, delete, rename, write (detected via close-modified), and on macOS 26+, chmod and chown via attribute change events. Every file event is attributed to the originating session and command through PID-based resolution, providing full audit trails across subprocess trees.

ESF provides kernel-level allow/deny enforcement but does not support transparent file interception like Linux FUSE. Policy actions that require interception -- such as redirect (path rewriting) and soft_delete (quarantine) -- are implemented as deny + guidance: the operation is blocked at the ESF level and the agent receives instructions to retry with the correct path or to acknowledge that the file is protected. See the macOS ESF+NE architecture doc for event stream details and the policy documentation for per-action behavior.


Starter policy packs

You already have a default policy (configs/policies/default.yaml). These opinionated packs are available as separate files so teams can pick one:

  • policies/dev-safe.yaml: safe for local development

    • allow workspace read/write
    • approve deletes in workspace
    • deny ~/.ssh/**, /root/.ssh/**
    • restrict network to allowlisted domains/ports
  • policies/ci-strict.yaml: safe for CI runners

    • deny anything outside workspace
    • deny outbound network except artifact registries
    • deny interactive shells unless explicitly allowed
    • audit everything (summary events)
  • policies/agent-sandbox.yaml: "agent runs unknown code" mode

    • default deny + explicit allowlist
    • approve any credential/path access
    • redirect network tool usage to internal proxies/mirrors
    • soft-delete destructive operations for easy recovery

AI Assistant Integration Examples

Ready-to-use snippets for configuring AI coding assistants to use agentmon:

  • Claude Code - CLAUDE.md snippet for Claude Code integration
  • Cursor - Cursor rules for agentmon integration
  • AGENTS.md - Generic AGENTS.md snippet (works with multiple AI tools)

Note: These examples are for local development scenarios where running the AI agent inside a container isn't practical. For production or CI/CD environments, prefer running agents in containers with the shell shim installed—see Use in Docker.


References


Created with the help of agents for agents.

Directories

Path Synopsis
cmd
agentmon command
agentmon-rlimit-exec command
agentmon-rlimit-exec is a wrapper that applies resource limits before exec'ing a command.
agentmon-rlimit-exec is a wrapper that applies resource limits before exec'ing a command.
agentmon-stub command
dbclassify-pg command
Command dbclassify-pg is an operator CLI that runs the Plan 03 PostgreSQL classifier on stdin and prints a JSON report on stdout.
Command dbclassify-pg is an operator CLI that runs the Plan 03 PostgreSQL classifier on stdin and prints a JSON report on stdout.
pnacl-monitor command
Quick test to run PNACL monitor with eBPF
Quick test to run PNACL monitor with eBPF
seccomp-probe command
wtp-testserver command
Command wtp-testserver runs a hermetic WTP server bound to a local TCP port.
Command wtp-testserver runs a hermetic WTP server bound to a local TCP port.
internal
api
audit
Package audit provides tamper-proof audit logging with HMAC-based integrity chains.
Package audit provides tamper-proof audit logging with HMAC-based integrity chains.
audit/kms
Package kms provides key management system integrations for audit integrity keys.
Package kms provides key management system integrations for audit integrity keys.
capabilities
Package capabilities provides runtime checks for kernel and system capabilities required by agentmon sandbox features.
Package capabilities provides runtime checks for kernel and system capabilities required by agentmon sandbox features.
cli
internal/cli/mcp_cmd.go
internal/cli/mcp_cmd.go
config
internal/config/ptrace.go
internal/config/ptrace.go
db/classify/postgres
Package postgres — ast_copy.go owns the §7.3 COPY family.
Package postgres — ast_copy.go owns the §7.3 COPY family.
db/classify/postgres/corpus
Package corpus declares the on-disk shape of classifier golden fixtures.
Package corpus declares the on-disk shape of classifier golden fixtures.
db/effects
internal/db/effects/alias.go
internal/db/effects/alias.go
db/events
internal/db/events/event.go
internal/db/events/event.go
db/policy
Package policy implements the AgentMon database-access policy evaluator per docs/agentmon-db-access-spec.md §9–§10.
Package policy implements the AgentMon database-access policy evaluator per docs/agentmon-db-access-spec.md §9–§10.
db/proxy/postgres
Package postgres implements the AgentMon PostgreSQL proxy per docs/agentmon-db-access-spec.md §11–§14 and the macro design at docs/superpowers/specs/2026-05-10-db-plan-04-pg-proxy-skeleton-design.md.
Package postgres implements the AgentMon PostgreSQL proxy per docs/agentmon-db-access-spec.md §11–§14 and the macro design at docs/superpowers/specs/2026-05-10-db-plan-04-pg-proxy-skeleton-design.md.
db/proxy/postgres/preparedcache
Package preparedcache is a per-connection LRU prepared-statement cache used by the PostgreSQL proxy.
Package preparedcache is a per-connection LRU prepared-statement cache used by the PostgreSQL proxy.
db/proxy/postgres/statemachine
Package statemachine implements the PostgreSQL proxy's Extended Query and transaction state machine per docs/agentmon-db-access-spec.md §14 and the design doc 2026-05-11-db-plan-05-pg-extended-tx-design.md §4.
Package statemachine implements the PostgreSQL proxy's Extended Query and transaction state machine per docs/agentmon-db-access-spec.md §14 and the design doc 2026-05-11-db-plan-05-pg-extended-tx-design.md §4.
db/tlsleaf
Package tlsleaf provides a lazily-generated self-signed CA and per-hostname leaf issuer for the AgentMon DB proxy's TLS termination path.
Package tlsleaf provides a lazily-generated self-signed CA and per-hostname leaf issuer for the AgentMon DB proxy's TLS termination path.
decisionctx
Package decisionctx resolves a process-level "decision context" (identity + environment signals) that AgentMon reports to Watchtower so the server can resolve the bound policy.
Package decisionctx resolves a process-level "decision context" (identity + environment signals) that AgentMon reports to Watchtower so the server can resolve the bound policy.
envinject
Package envinject applies operator-configured environment variable injection (sandbox.env_inject) to a process environment.
Package envinject applies operator-configured environment variable injection (sandbox.env_inject) to a process environment.
httpretry
Package httpretry provides a bounded-retry HTTP client and a circuit breaker for calling external providers.
Package httpretry provides a bounded-retry HTTP client and a circuit breaker for calling external providers.
inspect
Package inspect runs content through inspection providers and resolves the policy engine's `inspect` decision against what they find.
Package inspect runs content through inspection providers and resolves the policy engine's `inspect` decision against what they find.
inspect/provider
Package provider holds inspection provider implementations.
Package provider holds inspection provider implementations.
inspect/provider/onnxrt
Package onnxrt calls ONNX Runtime from Go without cgo.
Package onnxrt calls ONNX Runtime from Go without cgo.
inspect/provider/onnxrt/gen command
Command gen-ort-api extracts the OrtApi struct member order from onnxruntime_c_api.h and writes it as Go constants.
Command gen-ort-api extracts the OrtApi struct member order from onnxruntime_c_api.h and writes it as Go constants.
inspect/provider/privacyfilter
Package privacyfilter decodes OpenAI Privacy Filter output into spans.
Package privacyfilter decodes OpenAI Privacy Filter output into spans.
inspect/provider/privacyfilter/modelcache
Package modelcache downloads and verifies model files.
Package modelcache downloads and verifies model files.
inspect/provider/privacyfilter/tokenizer
Package tokenizer implements the byte-level BPE tokenizer that openai/privacy-filter was trained with.
Package tokenizer implements the byte-level BPE tokenizer that openai/privacy-filter was trained with.
integration/fargate
Package fargate contains end-to-end tests that run on AWS Fargate.
Package fargate contains end-to-end tests that run on AWS Fargate.
ipc
ipset
Package ipset provides membership testing for sets of individual IP addresses and CIDR ranges.
Package ipset provides membership testing for sets of individual IP addresses and CIDR ranges.
mcpclient
Package mcpclient provides helpers for connecting to HTTP/SSE MCP servers.
Package mcpclient provides helpers for connecting to HTTP/SSE MCP servers.
mcpinspect
Package mcpinspect provides MCP (Model Context Protocol) message inspection for security monitoring.
Package mcpinspect provides MCP (Model Context Protocol) message inspection for security monitoring.
mcpregistry
Package mcpregistry provides an in-memory registry that maps MCP tool names to their server metadata.
Package mcpregistry provides an in-memory registry that maps MCP tool names to their server metadata.
netmonitor/pnacl
Package pnacl provides Process Network ACL (PNACL) functionality for per-process network access control policies.
Package pnacl provides Process Network ACL (PNACL) functionality for per-process network access control policies.
netmonitor/unix
internal/netmonitor/unix/depth_tracker.go
internal/netmonitor/unix/depth_tracker.go
ocsf
Package ocsf maps agentmon events to OCSF v1.8.0 class payloads consumed by the WTP CompactEvent wire shape.
Package ocsf maps agentmon events to OCSF v1.8.0 class payloads consumed by the WTP CompactEvent wire shape.
pathutil
Package pathutil provides path boundary checking helpers shared across packages that need to determine whether a filesystem path is under a root.
Package pathutil provides path boundary checking helpers shared across packages that need to determine whether a filesystem path is under a root.
platform
Package platform provides cross-platform abstractions for filesystem, network, sandbox, and resource management.
Package platform provides cross-platform abstractions for filesystem, network, sandbox, and resource management.
platform/darwin
Package darwin provides stubs for non-macOS platforms.
Package darwin provides stubs for non-macOS platforms.
platform/darwin/sbpl
Package sbpl constructs valid SBPL (Sandbox Profile Language) strings via a typed Go API.
Package sbpl constructs valid SBPL (Sandbox Profile Language) strings via a typed Go API.
platform/fuse
Package fuse provides cross-platform FUSE filesystem mounting using cgofuse.
Package fuse provides cross-platform FUSE filesystem mounting using cgofuse.
platform/helperbin
Package helperbin resolves the auxiliary binaries agentmon execs at runtime (agentmon-macwrap, agentmon-stub, agentmon-shell-shim).
Package helperbin resolves the auxiliary binaries agentmon execs at runtime (agentmon-macwrap, agentmon-stub, agentmon-shell-shim).
platform/lima
Package lima provides the macOS Lima VM platform implementation for agentmon.
Package lima provides the macOS Lima VM platform implementation for agentmon.
platform/linux
Package linux provides the Linux platform implementation for agentmon.
Package linux provides the Linux platform implementation for agentmon.
policy/ancestry
Package ancestry provides process ancestry tracking and taint propagation for parent-conditional policy enforcement.
Package ancestry provides process ancestry tracking and taint propagation for parent-conditional policy enforcement.
policy/identity
Package identity provides cross-platform process identification.
Package identity provides cross-platform process identification.
policy/pattern
Package pattern provides pattern matching for process identification.
Package pattern provides pattern matching for process identification.
policygen
internal/policygen/generator.go
internal/policygen/generator.go
policyserve
Package policyserve serves signed policy bundles to agents over HTTP.
Package policyserve serves signed policy bundles to agents over HTTP.
proxy
Package proxy provides an embedded HTTP proxy for intercepting outbound requests from the sandboxed agent.
Package proxy provides an embedded HTTP proxy for intercepting outbound requests from the sandboxed agent.
proxy/credsub
Package credsub implements the per-session credential substitution table that maps fake credentials (the bytes an agent sees in its environment) to real credentials (the bytes sent upstream).
Package credsub implements the per-session credential substitution table that maps fake credentials (the bytes an agent sees in its environment) to real credentials (the bytes sent upstream).
proxy/secrets
Package secrets defines the SecretProvider interface that agentmon uses to fetch real credentials from external secret stores at session start, plus the URI grammar, sentinel errors, and the provider Registry shared by all provider implementations.
Package secrets defines the SecretProvider interface that agentmon uses to fetch real credentials from external secret stores at session start, plus the URI grammar, sentinel errors, and the provider Registry shared by all provider implementations.
proxy/secrets/awssm
Package awssm implements secrets.SecretProvider using AWS Secrets Manager.
Package awssm implements secrets.SecretProvider using AWS Secrets Manager.
proxy/secrets/azurekv
Package azurekv implements secrets.SecretProvider using Azure Key Vault.
Package azurekv implements secrets.SecretProvider using Azure Key Vault.
proxy/secrets/gcpsm
Package gcpsm implements secrets.SecretProvider using GCP Secret Manager.
Package gcpsm implements secrets.SecretProvider using GCP Secret Manager.
proxy/secrets/keyring
Package keyring implements secrets.SecretProvider using the OS keyring: macOS Keychain (via /usr/bin/security), Linux Secret Service (via D-Bus), or Windows Credential Manager.
Package keyring implements secrets.SecretProvider using the OS keyring: macOS Keychain (via /usr/bin/security), Linux Secret Service (via D-Bus), or Windows Credential Manager.
proxy/secrets/onepassword
Package onepassword implements secrets.SecretProvider using the 1Password Connect API.
Package onepassword implements secrets.SecretProvider using the 1Password Connect API.
proxy/secrets/secretstest
Package secretstest provides test doubles for the secrets.SecretProvider interface.
Package secretstest provides test doubles for the secrets.SecretProvider interface.
proxy/secrets/vault
Package vault implements secrets.SecretProvider using HashiCorp Vault's KV v2 secrets engine.
Package vault implements secrets.SecretProvider using HashiCorp Vault's KV v2 secrets engine.
ptrace
Package ptrace implements a ptrace-based syscall tracer backend for agentmon.
Package ptrace implements a ptrace-based syscall tracer backend for agentmon.
pty
safepath
Package safepath opens files and directories that live where an untrusted process can also write, without adopting whatever it finds there.
Package safepath opens files and directories that live where an untrusted process can also write, without adopting whatever it finds there.
shellparse
Package shellparse extracts the policy-relevant binary from a shell-wrapped invocation like `sh -c "shutdown now"`.
Package shellparse extracts the policy-relevant binary from a shell-wrapped invocation like `sh -c "shutdown now"`.
shim
Package shim provides the shell shim infrastructure for agentmon.
Package shim provides the shell shim infrastructure for agentmon.
shim/kernelinstall
Package kernelinstall lets the shim install seccomp + Landlock on its own process before execve, so the user's command inherits the filter even when the shim is not a child of the agentmon server (sandbox-SDK pattern).
Package kernelinstall lets the shim install seccomp + Landlock on its own process before execve, so the user's command inherits the filter even when the shim is not a child of the agentmon server (sandbox-SDK pattern).
signal
internal/signal/engine.go
internal/signal/engine.go
skillcheck
Package skillcheck scans AI agent skill installations (Claude Code skill directories) for prompt injection, exfiltration, hidden Unicode, scope violations, and other supply-chain risks before they become loadable by the agent.
Package skillcheck scans AI agent skill installations (Claude Code skill directories) for prompt injection, exfiltration, hidden Unicode, scope violations, and other supply-chain risks before they become loadable by the agent.
store/eventfilter
Package eventfilter provides shared event-filter semantics used by chained audit sinks (OTEL, Watchtower).
Package eventfilter provides shared event-filter semantics used by chained audit sinks (OTEL, Watchtower).
store/otel
Package otel implements a store.EventStore that exports events via OpenTelemetry (OTLP).
Package otel implements a store.EventStore that exports events via OpenTelemetry (OTLP).
store/watchtower
Package watchtower implements a store.EventStore that ships events to a Watchtower endpoint via the WTP protocol.
Package watchtower implements a store.EventStore that ships events to a Watchtower endpoint via the WTP protocol.
store/watchtower/chain
Package chain provides WTP-specific helpers around audit.SinkChain.
Package chain provides WTP-specific helpers around audit.SinkChain.
store/watchtower/cmd/gen-wire-goldens command
Command gen-wire-goldens regenerates wire-format goldens for WTP messages.
Command gen-wire-goldens regenerates wire-format goldens for WTP messages.
store/watchtower/cmd/gen-wire-goldens/fixtures
Package fixtures owns the canonical construction of the WTP wire-format goldens.
Package fixtures owns the canonical construction of the WTP wire-format goldens.
store/watchtower/compact
Package compact projects agentmon events into the WTP CompactEvent wire shape.
Package compact projects agentmon events into the WTP CompactEvent wire shape.
store/watchtower/testserver
Package testserver is a hermetic, in-process WTP (Watchtower Transport Protocol) server built on top of google.golang.org/grpc/test/bufconn.
Package testserver is a hermetic, in-process WTP (Watchtower Transport Protocol) server built on top of google.golang.org/grpc/test/bufconn.
store/watchtower/transport/compress
Package compress provides per-batch compression encoders for the WTP transport.
Package compress provides per-batch compression encoders for the WTP transport.
store/watchtower/wal
Package wal implements the WTP write-ahead log: framed records inside generation-tagged segment files, with CRC32C-Castagnoli per record and an atomic .INPROGRESS → .seg seal.
Package wal implements the WTP write-ahead log: framed records inside generation-tagged segment files, with CRC32C-Castagnoli per record and an atomic .INPROGRESS → .seg seal.
tor
wrapenv
Package wrapenv applies env_policy filtering to the inherited environment on the client-spawned wrap path (shell shim / kernel-install / agentmon wrap), the counterpart to server-side buildPolicyEnv.
Package wrapenv applies env_policy filtering to the inherited environment on the client-spawned wrap path (shell shim / kernel-install / agentmon wrap), the counterpart to server-side buildPolicyEnv.
wrapperlog
Package wrapperlog defines the env contract and fallback file destination for routing agentmon-unixwrap diagnostics off the wrapped command's stderr (issue #415).
Package wrapperlog defines the env contract and fallback file destination for routing agentmon-unixwrap diagnostics off the wrapped command's stderr (issue #415).
pkg
cli
observability
Package observability provides Prometheus metrics, OpenTelemetry tracing, and structured logging for agentmon.
Package observability provides Prometheus metrics, OpenTelemetry tracing, and structured logging for agentmon.
ratelimit
Package ratelimit provides rate limiting and quota management for agentmon.
Package ratelimit provides rate limiting and quota management for agentmon.
simulation
Package simulation provides testing and simulation modes for agentmon.
Package simulation provides testing and simulation modes for agentmon.
scripts
docker-test command
sigurg_probe is a best-effort sanity check that the WAIT_KILLABLE_RECV flag is functionally engaged end-to-end.
sigurg_probe is a best-effort sanity check that the WAIT_KILLABLE_RECV flag is functionally engaged end-to-end.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL