
SMT Contract & Policy Logic Prover
Answers a yes/no logic question about contract clauses, IAM/OPA policies or business rules with a solver-backed result and a plain-language headline and next step. Takes clauses or pasted text (or a formal IR directly with zero LLM calls), formalizes them into typed Boolean, integer and rational constraints, then answers "is P possible", "does invariant I always hold" or "are any clauses contradictory" with a pure-TypeScript CDCL(T) solver (exact rational simplex, branch-and-bound, minimal unsatisfiable cores). SAT returns an exact counterexample checked against every original constraint; UNSAT reports the proof statement and the minimal conflicting clause ids; exhausted budgets return UNKNOWN. Natural-language input uses two independent formalizations whose logical equivalence is checked by the solver; disagreements are reported with a distinguishing assignment and lower confidence. Formal elements whose source quote is not in the text are dropped. The proof is exact for the formalization, not for the original wording, and is not legal advice.
What you get
Finds the loophole, contradiction or privilege-escalation path in contract clauses, IAM/OPA policies and business rules with a solver, returning an exact counterexample or a minimal set of conflicting clauses instead of an opinion.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/prove-contract-logic. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/prove-contract-logic \
-H 'content-type: application/json' \
-d '{"clauses":[{"id":"C1","text":"Any payout request may be approved by a manager."},{"id":"C2","text":"Payouts above $10,000 require approval by a director."},{"id":"C3","text":"A manager is never a director."}],"query":"Can a payout above $10,000 be approved by a manager?"}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
clauses | array<object>; max 200 items | no | Natural-language contract clauses, IAM/OPA policy statements or business rules, each with a caller-chosen id. Mutually exclusive with ir. |
text | string; length 3..60000 | no | Alternative to clauses: the contract, policy or rules pasted as plain text. It is split into clauses by blank lines and numbered or bulleted lines (ids C1.2 or S3). Use clauses when you need your own ids. Requires query. |
query | string; length 1..1000 | no | The question, e.g. "Can an unauthorized user ever approve a payout over $10,000?" or "Are any clauses mutually contradictory?". Required with clauses. |
ir | object | no | Formal IR, solved with zero LLM calls: {variables:[{name,type:bool|int|real,min?,max?}], constraints:[{id,expr,source?}], query:{mode:possible|always|consistency,formula?,source?}}. Expressions are JSON ASTs: {op:"var",name}, {op:"num",value:"3/4"}, {op:"true"|"false"}, and {op,args} for not, and, or, implies, iff, ite, =, !=, <, <=, >, >=, add, sub, neg, mul (one side constant). Numbers are exact strings. |
budget | object | no | Optional lower step budgets. |
Example request body
{
"clauses": [
{
"id": "C1",
"text": "Any payout request may be approved by a manager."
},
{
"id": "C2",
"text": "Payouts above $10,000 require approval by a director."
},
{
"id": "C3",
"text": "A manager is never a director."
}
],
"query": "Can a payout above $10,000 be approved by a manager?"
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
deterministic | boolean | yes | True when no LLM touched the verdict path (formal IR input). |
headline | string | yes | The answer in one or two sentences, rendered from the solver result (witness values or conflicting clause ids). |
nextStep | string | yes | What to do with this result. |
status | string; one of "SAT", "UNSAT", "UNKNOWN" | yes | |
verdict | string; one of "POSSIBLE", "IMPOSSIBLE", "INVARIANT_VIOLATED", "INVARIANT_PROVED", "CONSISTENT", "INCONSISTENT", "UNKNOWN", "TRANSLATION_DISAGREEMENT" | yes | |
mode | string; one of "possible", "always", "consistency" | yes | |
confidence | string; one of "high", "medium", "low" | yes | |
result | object | yes | |
translation | object | no | |
audit | object | yes |
Pay and connect
Available through: x402 (USDC on Base), MCP, RapidAPI, Apify.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent