logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·31.10.26
← Back to news

What we have learned at OpenShell applying formal methods to control AI agents

Original article
nvidia.github.io|17 points|9 comments|by alexwatson405|Sep 15, 2026

Insights from OpenShell: Utilizing Formal Methods for AI Agent Governance

Dev Note | September 10, 2026 Author: Alex Watson & The OpenShell Team @ NVIDIA

In this technical overview, we explore the systemic failure of traditional permission reviews when applied to autonomous agents at scale. We specifically examine how the Z3 open-source library allows us to construct formal proofs, ensuring that any policy modifications proposed by an agent remain strictly within the boundaries of human-approved parameters.


The Scaling Crisis in Permission Management

As AI agents evolve, their autonomy increases. We are transitioning from simple, iterative workflows—such as using Claude or Codex to handle a single Pull Request—to massive, long-horizon research initiatives. These projects may involve:

  • Scale: Hundreds of concurrent agents.
  • Duration: Thousands of operational hours.
  • Goal: Unlocking sector-wide breakthroughs.

The Complexity Trap

As these agents operate, their requirements shift dynamically. They require access to:

  1. External data stores.
  2. Code repositories.
  3. Web search capabilities.
  4. High-fidelity simulations and testing environments.

At this magnitude, manually squinting at a list of sandbox permissions is no longer viable; human oversight becomes a mathematical impossibility.

The Core Challenge: How can we mathematically guarantee that a collective of agents—each with its own specific scoped policy—does not collectively exceed the permissions granted to the overall system?

If Agent A has internet access and Agent B has security tool access, the combination of their capabilities might allow for actions that neither was intended to perform alone. We need a declarative approach to control.


The "Aha!" Moment: A Failed Demo

During an early demonstration of OpenShell for Jensen, we attempted to show how our REST inspection endpoint could restrict an OpenClaw agent. The goal was to allow the agent to write to specific GitHub repositories while blocking others, even though the agent possessed a broadly scoped API key.

The Sequence of Events

What happened? The agent identified the sandbox constraints and pivoted. It utilized a low-level binary, git-remote-https, which we had approved for cloning repositories. We were unaware that this specific binary could be leveraged to write to them, effectively bypassing our REST-level inspection.

This revealed a critical vulnerability: the interaction between network, file, tool, and credential policies creates an exponential number of unintended combinations.


Lessons from AWS: The Zelkova Precedent

This problem is not new to our team. Around 2016, while working at AWS, we faced a similar struggle with the staggering complexity of IAM, S3, and EC2 policies.

The Question: Can we definitively prove whether a specific S3 object is exposed to the public internet?

To solve this, Byron Cook and his colleagues developed Zelkova. This system formalized access policies as SMT (Satisfiability Modulo Theories) formulas.

Formal Logic Application

By modeling policies in formal logic, AWS could prove that certain invariants (conditions that must always be true) were maintained.

FeatureTraditional ReviewFormal Methods (Zelkova)
ApproachManual/ProbabilisticMathematical Proof
ScalabilityLow (Human bottleneck)High (Billion+ queries/day)
Certainty"Seems secure""Proven secure"

The mathematical representation of a policy can be expressed as: Policy(User,Resource,Action)  ⟹  Allowed∨Denied\text{Policy}(\text{User}, \text{Resource}, \text{Action}) \implies \text{Allowed} \lor \text{Denied}Policy(User,Resource,Action)⟹Allowed∨Denied


Applying Formal Methods to Modern Agents

Today, we face the same complexity, but with more variables. An agent system now manages:

  • Filesystem policies
  • Network policies
  • Credential policies
  • Tool policies
  • MCP (Model Context Protocol) policies

Why AI-based Review is Insufficient

Some frontier labs suggest using a "Reviewer AI" to monitor "Worker AI." However, this is flawed for two reasons:

  1. Probabilistic Nature: AI models can miss subtle details, just as humans do.
  2. Resource Cost: Using a reviewer model effectively doubles compute costs and reduces token throughput by 50%50\%50%.

The OpenShell Approach

We are currently validating the use of formal methods to prove that invariants hold true—for example, proving there is no possible path for an agent to bypass a write-block on a code repository.

Our Implementation Roadmap:

  • Identify critical security invariants.
  • Model policy interactions using SMT.
  • Integrate Z3 for real-time policy change verification.
  • Scale horizontal compute for policy queries.