Autoformalization and verification for AI agents

AI That Reasons Is Not Enough.
We Need AI That Proves.

The agent reasons with a model. It acts within a proof. Write your policy in English. Nirnaya verifies it and enforces it on your agents.

p ∈ Policy(NL)  —⟦·⟧→  O ∈ Obligations  —review→  O′ ∈ Verified  —compile→  φ ∈ Spec
Policy
⟦·⟧
Formalized

      
Proved
✓ no gaps — every possible input is covered ✓ no conflicts — no input triggers two different rules ✓ every case accounted for
FINDING Insurance Claims bundle: overlapping rules detected between sections. First-match priority applied. This is what the system catches.
Agent calls tool

      
→
Enforced
Try with your policy See the problem
Gottfried Wilhelm Leibniz, 1695
Gottfried Wilhelm Leibniz
Philosopher, mathematician, logician
1646–1716

The Leibniz dream

Write it all in a precise enough symbolic language, and any dispute is settled by computation.

— The Leibniz dream, 1666

Leibniz envisioned a calculus ratiocinator: a formal system that could resolve any dispute by reducing language to logic and logic to computation. For 350 years this remained a dream.

Nirnaya is building towards it. We take natural-language policy, extract its formal obligations, verify completeness, and compile it to executable logic—closing the chain from human intent to machine enforcement.

Leibniz:  NL → Logic → Computation
Nirnaya:  Policy(NL) → Obligations → Spec → Enforce

The enforcement gap

Today's approaches sound right. They cannot prove they are right.

System prompts
  • –Suggestions, not constraints
  • –Overridable by design
  • –No audit artifact
  • –Silent drift across model versions
Guardrails frameworks
  • –Message-level checks, not policy logic
  • –Single inputs, not multi-variable conditions
  • –No completeness guarantee
  • –Code-first, not policy-first
Manual rule engines
  • –Hand-coded per tool, per policy
  • –Expensive to maintain
  • –Disconnected from source text
  • –Rules lag behind policy

Without proof

This is what unproved looks like.

3 in 4

healthcare organizations that deployed AI agents had to roll one back.

The leading trigger was not a technical failure. It was a governance failure: the agent acted on data it should not have accessed, or took an action no policy authorized.

Healthcare AI Governance Survey, 2026

83%

of organizations have no automated control between their AI and their data.

The model decides what to access. No formal boundary checks the decision. 86% have no visibility into what data flows into which model.

Kiteworks AI Security Report, 2025

$40B

in projected GenAI-enabled fraud losses in U.S. banking by 2027.

When the only constraint on an AI agent is a system prompt, adversarial inputs compound. Deloitte projects losses doubling year over year.

Deloitte Center for Financial Services

With Nirnaya

The policy is the source of truth. The proof is the enforcement.

01

Source-grounded

Write your policy in natural language. Nirnaya extracts the obligations, classifies them, and generates verified decision logic. The policy document is the spec.

02

Deterministic

Not a suggestion to the model. A gate outside the model that checks every tool call against proved rules. Same inputs, same decision, every time.

03

Selective escalation

Clear cases are auto-decided. Only genuinely ambiguous inputs are routed for human judgment. The system names the specific reason for review.

04

Traceable

From the agent action back to the rule, back to the source obligation, back to the policy sentence. Audit-ready by construction.

The thesis

For operational AI, the output is not the only answer. The proof is.

An agent that cannot distinguish what it does not know (epistemic) from what no one can know (aleatoric) cannot be trusted to act alone. Nirnaya gives agents the missing piece: verified policy, calibrated uncertainty, and the judgment to stop.

Epistemic

The agent does not know enough

Missing facts, ambiguous inputs, incomplete context. The right action is to gather more information before deciding. Nirnaya identifies what facts are needed and requests them from the system of record.

→ REQUIRE_FACTS(auth_status, patient_id)
Aleatoric

The outcome is inherently uncertain

Edge cases, conflicting rules, novel situations the policy was not designed for. No amount of data resolves it. The right action is to route to a human who can exercise judgment.

→ REVIEW(reason: novel_input_combination)

What Nirnaya does

From human knowledge to machine-checkable enforcement.

The stack translates natural-language policies into verified decision logic and enforces it at every tool call.

Extract

Policy formalization

Upload policy text. AI extracts typed obligations, classifies each as executable, informational, or ambiguous. Human reviews and approves.

Verify

Formal proof

Decision table is mathematically proved complete and contradiction-free. Generates deterministic code. No input escapes without a rule.

Enforce

Runtime guard

Signed bundle sits at the tool-call boundary. Every action checked against the proved logic. Allow, deny, or route to human. Zero latency.

Audit

Decision record

Every decision logged with the rule that fired, the source obligation, and the input state. Traceable from action back to policy text.

Routing outcomes

Three outcomes. Different operational meanings.

Allow

Policy permits the action

The action clears the verified decision logic. It proceeds without human review. Logged with rule ID and source trace.

Review

Requires human judgment

The policy requires approval for this input combination. The system names the specific reason. The agent waits.

Deny

Policy blocks the action

The action violates a verified rule. The agent receives the reason and the source obligation. Cannot proceed.

What you get

Every verified policy produces artifacts your team can use.

Proved guard code

Deterministic Python function generated from the verified spec. Every branch corresponds to a proved rule. Drop into your codebase or use the SDK.

AI evaluation cases

Auto-generated test scenarios covering boundary conditions, edge cases, and adversarial inputs. Run them in CI to catch policy regressions.

Edge case detection

Inputs where rules nearly overlap or small changes flip the outcome. Surfaced automatically so reviewers focus on what matters.

Source traceability

Every rule traces back to the policy sentence it came from. When a decision fires, show the auditor the exact source text.

Signed bundle

Verified spec, proved code, and tool bindings packaged into a signed, tamper-evident, versioned artifact. Ready for deployment.

Framework adapters

Working integration for OpenAI Agents, LangGraph, MCP, and raw Python. Generated from the policy, not boilerplate.

Bring us a policy.

If it has rules, constraints, and consequences, it can be formalized.

Try it now