TypeScript · Vitest · local first

Put a failing test between your agent and a dangerous tool.

Deterministic action-safety tests for tool-using agents. Prove approval, ordering, arguments, and limits before a model or prompt change reaches production.

LatchSpec is the working name for this private pilot; public-name clearance and package reservation are pending.

refund.contract.tsVITEST
const contract = defineAgentContract({ name: "refund-agent", invariants: [ mustCall("lookupOrder"), approvedBefore("issueRefund", "refund"), maxCalls("issueRefund", 1), ] });
×Contract failed — issueRefund ran before approval

01 Observable behavior

02 Partial-order traces

03 Fault-injected tools

04 CI-native verdicts

Agents are probabilistic.
Actions don't have to be.

A schema can stay compatible while a model stops choosing the right tool. LatchSpec turns the behaviors you cannot afford to lose into executable, reviewable tests inside the workflow your TypeScript team already uses.

What a contract proves

01

Human authority

Prove approval happened before a destructive tool call, not somewhere nearby in a transcript.

02

Action boundaries

Require the right tool, prohibit the wrong one, and validate arguments without hidden reasoning.

03

Operational limits

Fail the build when retries, steps, latency, tokens, or cost cross the declared boundary.

Five design-partner teams

Bring one action you can't afford to get wrong.

We'll translate a real incident or approval policy into a deterministic contract, wire it into your test suite, and measure time to the next contract your team writes alone.

Apply for the pilot →