Put one governed call on the wire.
1. Install your SDK
Both SDKs are live at version 0.0.3. Pick either tab. The docs remember your
choice as you move through the site.
Install
One platform contract, two first-class SDKs.
- Python
- TypeScript
pip install trinitite==0.0.3
npm install @trinitite/sdk@0.0.3
2. Add a test key
Set the key and its matching environment. Test mode lets you exercise every verdict path without sending test controls into production.
Environment
Use a test key for your first integration.
- Python
- TypeScript
TRINITITE_API_KEY=trnt_test_...
TRINITITE_ENV=test
TRINITITE_API_KEY=trnt_test_...
TRINITITE_ENV=test
Environment keyring
The key prefix must match the environment
- Key prefix
- trnt_test_...
- Use
- Forced verdicts and CI
Need a key? Request a sandbox tenant.
3. Make the call
Set your baseline once, then call the model you already chose. The SDK sends the request through the same governed path in both languages.
First governed call
The tabs stay in sync with the language you chose above.
- Python
- TypeScript
from trinitite import Trinitite
tr = Trinitite()
tr.govern(frameworks=["soc2"], mode="enforce")
response = tr.client(
"openai",
credential="cred_openai_prod",
).chat.completions.create(
model="gpt-4o",
messages=[{
"role": "user",
"content": "Refund order 4821.",
}],
)
result = tr.result(response)
print(result.verdict)
import { Trinitite } from "@trinitite/sdk";
const tr = new Trinitite();
await tr.govern({
frameworks: ["soc2"],
mode: "enforce",
});
const response = await tr.client("openai", {
credential: "cred_openai_prod",
}).chat.completions.create({
model: "gpt-4o",
messages: [{
role: "user",
content: "Refund order 4821.",
}],
});
const result = tr.result(response);
console.log(result.verdict);
- verdict
- passed
- violations
- []
- receipt
- dlir_01J7FIRSTCALL
The verdict drives the app path. The receipt records the decision.
First call complete
Your app now has a decision it can use
The verdict drives the next code path. The explanation helps your team improve it. The receipt keeps the proof.
4. Use the verdict
The lowercase verdict is the stable branch for your app. Start with the three paths most apps need, then add masking, human review, and failure handling.
Branch on the result
The app path stays simple even when the rules grow.
- Python
- TypeScript
if result.verdict == "passed":
show(result.body)
elif result.verdict == "corrected":
show(result.body)
log_changes(result.diff)
elif result.verdict == "blocked":
show_safe_fallback()
elif result.verdict == "masked":
keep_tokens_outside_trust_boundary()
elif result.verdict == "hitl":
queue_for_review()
else:
follow_error_policy()
switch (result.verdict) {
case "passed":
show(result.body);
break;
case "corrected":
show(result.body);
logChanges(result.diff);
break;
case "blocked":
showSafeFallback();
break;
case "masked":
keepTokensOutsideTrustBoundary();
break;
case "hitl":
queueForReview();
break;
default:
followErrorPolicy();
}
You are ready for the mental model
You now have the key idea: your model call stays familiar, while the app gains a clear result and the organization gains a shared trail for testing and improvement.