Back to browse
GitHub Repository
0 starsPython

I built a static verifier for OpenCode to stop unsafe AI tool calls

by abj908·Jul 27, 2026·1 point·0 comments

AI Analysis

●●SolidBig BrainNiche Gem

Brings Erik Meijer's formal verification paper to life for OpenCode agent security.

Strengths
  • Uses Z3 SMT solver to mathematically prove path containment and block directory traversal.
  • Implements secret taint tracking to prevent .env data from leaking into shell commands.
  • Security automata enforce stateful rules like read-before-edit on file operations.
Weaknesses
  • Requires running a separate Python sidecar daemon, adding operational complexity.
  • Only supports OpenCode, limiting utility for users of Cursor, Copilot, or other agents.
Category
Target Audience

Developers using AI coding agents who need strict security guardrails

Similar To

Guardians · LLM Guard · Rebuff

Post Description

Erik Meijer wrote the paper "Guardians of the Agents" on formal verification for AI workflows, and Nada Amin implemented it in the Guardians repository. I built this plugin to bring static security verification to OpenCode.

How It Works: 1. Interception: Uses OpenCode's TypeScript plugin system ("tool.execute.before") to intercept candidate tool calls (bash, read, edit, write) before they run. 2. Sidecar Verification: Passes tool parameters to a local Python daemon running guardians.verify(). 3. Formal Verification (~1.5ms): Evaluates Z3 path containment (blocking path traversal like ../../../../etc/passwd), secret taint tracking (preventing .env data from flowing to output files or shell commands), and security automata (enforcing read-before-edit rules). 4. Pre-Execution Abort: If a violation is flagged, the plugin throws an exception to block execution before any side effects happen on disk, forcing the agent to self-correct.

The repository links metareflection/guardians directly as a Git submodule (guardians-core), keeping the core verifier untouched and synced with upstream updates.

Repo & Setup Instructions: https://github.com/albertjoseph0/opencode-plugin-guardians

I would love to hear your thoughts or feedback!

Similar Projects

Security●●●Banger

Guardians – Verify tool-using agent workflows before execution

Applies formal verification to prevent prompt injection before any tool executes.

WizardryBig BrainZero to One
namin
803mo ago
Security●●●Banger

verifiable API and MCP calls

Signed receipts for AI agent actions solve an accountability problem that didn't exist before MCP.

Zero to OneBig Brain
jithinraj
313mo ago
Security●●●Banger

VellaVeto — blocks unsafe MCP tool calls by default

Fail-closed MCP gateway with formal verification and MCPSEC benchmark suite.

Big BrainWizardryZero to One
paolovella
214mo ago