Local Guard
Free, local-only PDLSS verification for AI agents — YAML policy, adapters for Claude Code, CLI, Cursor, and browser agents.
A free, local-only verification layer for AI agents. Define what your agent can and cannot do in a simple YAML policy file, and Local Guard enforces it — no account, no cloud connection, no telemetry. When you outgrow local mode, one command upgrades you to cloud-connected verification.
Step 1: Create Your Policy
The proxy and IDE adapters below share one PDLSS policy file (local-policy.yaml). Create it
once, then choose which adapter to run for your platform. (The Claude Code adapter manages its own
.astrasync/policy.yaml — same schema, created for you at install.)
npm install @astrasyncai/verification-gateway
# Interactive wizard — creates local-policy.yaml
npx astrasync guard setupThe wizard asks plain-language questions about what your agent should be allowed to do and
generates a local-policy.yaml file using the same PDLSS schema as the cloud — so upgrading later
requires zero migration.
Step 2: Choose Your Adapter
Each adapter is a thin, platform-specific wrapper that intercepts agent actions and routes them through the shared PDLSS evaluation engine. The verification logic is identical across platforms — only the interception and enforcement mechanisms change.
Local Guard for Claude Code — Available
Native PreToolUse hook — no proxy. Every tool call (file, shell, web, and optionally MCP tools) is evaluated against your policy before it runs. One command installs the hook, a default policy, and guard settings.
# User-level (add --project for repo-scoped)
astrasync-guard install-claude-codeLocal Guard for OpenClaw CLI — Available
HTTP proxy that sits between OpenClaw (or other CLI agents) and their tool servers. Intercepts tool call JSON, evaluates against your PDLSS policy, then blocks or forwards. (Claude Code users: prefer the native hook adapter — no proxy needed.)
# Start the CLI proxy (uses your local-policy.yaml)
npx astrasync guard startLocal Guard for Cursor — Available
VS Code extension that hooks into file create/delete/save, terminal open, and command execution
events. Download the .vsix from GitHub releases and install directly.
# Download .vsix from GitHub releases, then:
code --install-extension astrasync-local-guard-2.0.0.vsixLocal Guard for OpenClaw Browser — Available
Chrome extension for the OpenClaw browser agent. Intercepts web requests and navigation before they execute, with synchronous local evaluation for zero-latency blocking.
# Download extension from GitHub releases, then:
# Chrome → Extensions → Developer mode → Load unpackedCLI Commands
| Command | Purpose |
|---|---|
astrasync guard setup | Interactive wizard to create your PDLSS policy file |
astrasync guard start | Start the local guard proxy with your policy |
astrasync guard status | Check guard status, mode, and recent activity |
astrasync guard upgrade | Upgrade from free local mode to cloud-connected verification |
astrasync-guard install-claude-code | Install the Claude Code PreToolUse hook + default policy (flags: --project, --wizard, --active, --policy <path>) |
astrasync-guard uninstall-claude-code | Remove the Claude Code hook (policy and traces are left in place) |
Postures & traces (all adapters)
Adapters that enforce inline (the Claude Code hook today) start in "posture": "passive": every
decision is evaluated and written to a local JSONL trace under .astrasync/traces/, but nothing
is blocked. Watch the traces until the policy looks right, then set "posture": "active" in
guard.json to enforce — denies block the action with a reason, approval-band actions route to
the platform's own permission prompt.
Safe by default: a machine with no policy file is a silent no-op, and a corrupt guard.json falls
back to enforcing defaults rather than silently loosening the guard. Set "governMcp": true to
govern MCP tools too (rules keyed as {server}.{tool}).
Free vs Paid
Local Mode (Free — free forever)
- Local PDLSS policy evaluation (<1ms)
- Interactive setup wizard
- CLI, IDE, and browser platform support
- JSONL audit trace (local file)
- No account required, fully offline
Online / Hybrid Mode (Paid)
- Everything in Local Mode
- ASTRA-ID and trust score for your agent
- Cloud PDLSS boundaries with counterparty verification
- Runtime challenge/response (proves agent identity)
- Blockchain-secured audit trail
- Git push / PR trigger for enterprise governance
Enterprise: Git Push Trigger
In hybrid mode, Local Guard runs locally during development but automatically switches to cloud verification when code is pushed to a remote repository or a PR is created. This creates a governance boundary: local guardrails for development, full AstraSync verification for anything that reaches the remote codebase.
# Install git hooks for your repo
npx astrasync guard install-hooks
# Hooks auto-trigger on:
# - git push (pre-push hook)
# - git commit to protected branches (pre-commit hook)
# - Block or warn mode configurable per branch
