SDKs
Client libraries.
JavaScript SDK available now. Python, Go, and Rust planned. The REST API is the integration surface for all other languages.
JS SDKREST API
Browser SDK — CDN (drop-in, no bundler required)
<script src="https://cdn.obligationsign.com/agts-sdk.min.js"></script>
<script>
const agts = new AGTS.Client({
apiKey: 'agts_live_...',
subjectId: 'my-chatbot:v2.0',
});
// Govern an AI decision
async function governedInference(userPrompt) {
const leaf = await agts.evidence({
G1: { result: 'PASS', confidence_interval_lower: 0.81, confidence_interval_upper: 0.95 },
G2: { result: 'PASS', causal_attribution: true },
G3: { result: 'PASS', protected_metrics: { toxicity_score: 0.02 } },
G4: { result: 'PASS', evidence_class: 'HOOKED' },
G5: { result: 'PASS', operator_id: 'ops@example.com' },
});
// leaf.leaf_hash is now in the transparency log
// leaf.replay_url is a permanent permalink to this decision
return callInferenceAPI(userPrompt);
}
// Verify a leaf
const proof = await agts.verify('8f3a1b...');
// Get compliance report
const report = await agts.report('c7d9e2...');
</script>
npm (Node.js / bundler)
npm install @obligationsign/agts-sdk
import { AGTSClient } from '@obligationsign/agts-sdk';
const agts = new AGTSClient({
apiKey: process.env.AGTS_API_KEY,
endpoint: 'https://api.obligationsign.com',
});
// Wire into your model deployment pipeline
async function governModelDeployment(modelVersion, evaluationResults) {
const leaf = await agts.evidence({
subjectId: `model:${modelVersion}`,
G1: evaluationResults.g1,
G2: evaluationResults.g2,
G3: evaluationResults.g3,
G4: evaluationResults.g4,
G5: { result: 'PASS', operator_id: process.env.DEPLOYER_ID },
evidence: evaluationResults.evidenceHashes,
});
console.log(`Governance leaf admitted: ${leaf.leaf_hash}`);
console.log(`Replay: ${leaf.replay_url}`);
return leaf;
}
SDK method reference
| Method | Returns | Description |
agts.evidence(gates, options?) | {leaf_hash, artifact_hash, replay_url, sth} | Submit governance evidence. Throws on gate failure with details. |
agts.verify(leafHash) | {included: boolean, proof: InclusionProof, sth: STH} | Verify a leaf by inclusion proof. Pure cryptographic operation. |
agts.report(artifactHash) | AGTS_COMPLIANCE_REPORT_V1 | Retrieve compliance report. Export requires L2 tier. |
agts.status() | ClearinghouseStatus | Current HCE observables, lifecycle state, trial status. |
agts.on('gate_fail', handler) | void | Register event handler for gate failures (browser SDK only). |
agts.execution(authLeafHash, metrics) | {exec_leaf_hash, variance_leaf_hash} | Submit execution trace (L2+). Triggers variance computation. |
Handling gate failures
try {
const leaf = await agts.evidence({ G1: {...}, ... });
deployModel();
} catch (err) {
if (err.code === 'GATE_FAILURE') {
console.error('Governance failed:', err.gates_failed);
console.error('Details:', err.details);
// Block deployment — governance said no
blockDeployment(err.details);
} else {
throw err;
}
}
Server-side SDKs (roadmap)
The REST API is the canonical integration surface. All AGTS operations are standard HTTP/JSON — any language can integrate today. Typed SDKs are on the roadmap:
Planned
Python
pip install agts
Synchronous and asyncio variants. Pydantic models for type safety. Use the REST API until this lands.
Planned
Go
go get github.com/obligationsign/agts-go
Idiomatic Go. Context-aware. Included Merkle proof verifier. Use the REST API until this lands.
Planned
Rust
cargo add agts
async/await. Tower middleware for service integration. Use the REST API until this lands.
Planned
Java / Kotlin
Maven / Gradle artifact
Spring Boot autoconfigure. Jakarta EE compatible. Use the REST API until this lands.
All SDKs will be MIT licensed and published on GitHub. Contributions welcome — the protocol is open; the infrastructure is commercial.