thoughtproof-sdk
v0.2.1
Published
SDK for ThoughtProof reasoning verification — verify AI agent decisions before they act
Maintainers
Readme
thoughtproof-sdk
SDK for ThoughtProof reasoning verification — verify AI agent decisions before they act.
Install
npm install thoughtproof-sdkQuick start
import { check } from "thoughtproof-sdk";
const result = await check({
claim: "Swap $2000 USDC to ETH. ETH at $2184, 6% below 30d MA, RSI 34.",
stakeLevel: "medium",
domain: "financial",
});
if (result.verdict === "ALLOW") {
// execute trade
} else if (result.paymentRequired) {
// pay $X USDC on Base, then retry
console.log(result.paymentRequired.instructions);
}API
check(params): Promise<CheckResult>
Verifies a claim or decision against ThoughtProof's reasoning integrity evaluators.
Params:
| Field | Type | Description |
| ------------ | ----------------------------------------------------- | ------------------------------------ |
| claim | string | The statement or decision to verify |
| context | string? | Additional context for the evaluator |
| domain | "financial" \| "medical" \| "legal" \| "code" \| "general" | Domain hint for evaluator routing |
| stakeLevel | "low" \| "medium" \| "high" \| "critical" | Risk level of the decision |
| speed | "standard" \| "deep" | Evaluation depth (default: standard) |
Result:
| Field | Description |
| ----------------- | ---------------------------------------------------------------- |
| verdict | "ALLOW" · "HOLD" · "UNCERTAIN" · "DISSENT" |
| confidence | 0–1 confidence score |
| attestation | Signed attestation (EdDSA) if payment was completed |
| paymentRequired | x402 payment details when the API requires USDC payment on Base |
| durationMs | Round-trip time in milliseconds |
configure(options)
Set a global API key or override the base URL:
import { configure } from "thoughtproof-sdk";
configure({
apiKey: process.env.THOUGHTPROOF_API_KEY,
baseUrl: "https://api.thoughtproof.ai", // optional
});Operators with an API key bypass x402 payment on every call.
Verdicts
| Verdict | Meaning |
| ------------- | ----------------------------------------------------------- |
| ALLOW | Claim passed — proceed with the action |
| HOLD | Payment required or flagged — do not proceed |
| UNCERTAIN | Evaluators could not reach confidence — consider human review |
| DISSENT | Claim failed verification — action blocked |
Requirements
- Node.js 18+ (uses native
fetch) - No runtime dependencies
License
MIT
