Certo
The trust & security layer for AI agents. Score what your agent did, not just what it answered — and block the actions it was never approved to take.
pip install certo-sdk
certo # what Certo can do
certo guard demo # watch an injected payment get blocked — offline, no account needed
certo login # then audit and trace your own agent
Your agent runs where it already runs. Certo receives its execution trace — reasoning steps, tool calls, hand-offs, final answer — and grades two things independently:
- Was the answer right? Checked against ground truth, a test suite, or a deterministic check. A wrong answer hard-gates the score; a pretty trajectory cannot rescue it.
- Was the path good? An LLM-judge ensemble scores every step and the run as a whole against explicit rubrics.
Both fold into one TrustScore (0–100).
The distinction matters because an agent that refunds the wrong customer's order and replies "Done — I refunded $240.00" looks perfect from the outside. The trajectory is where that shows up.
The package is small and pure-Python: httpx for the API, rich, rich-argparse and
questionary for the terminal. No tracing stack is pulled in unless you ask for it.
pip install "certo-sdk[otel]" # adds OpenTelemetry, for `instrument()`
[otel] is an extra — an optional dependency group. It pulls in
opentelemetry-api, opentelemetry-sdk and the OTLP HTTP exporter, which
certo.instrument() needs to stand up an exporter for a process that has none. If you
already export OpenTelemetry, you do not need it. Quote the argument: brackets are
special in zsh and PowerShell.
Three jobs, one layer
Auditing — Certo drives your agent through a 149-probe suite and reports what breaks. Tracing — your agent runs in production, Certo grades what it did, step by step. Guarding — every tool call is checked against what the user approved, before it runs.
Guarding tool calls
An agent reads untrusted text — an email, a web page, a tool result — and a sentence hidden in it can redirect its next tool call. The user approved paying 5; the agent sends 10. A filter that reads text cannot catch that: "send 10 to Spotify" looks harmless. The guard can, because it knows what was approved.
from certo import Guard, GuardDenied, Eq, Max
guard = Guard({
"read_inbox": {}, # allowed, unconstrained
"send_money": {"recipient": Eq("Spotify"), "amount": Max(5)},
}, task="Pay my Spotify subscription (approved: 5)")
@guard.protect # checked before the body runs
def send_money(recipient: str, amount: float, **extra): ...
send_money("Spotify", 5) # runs
send_money("Spotify", 10) # raises GuardDenied — the tool never ran
Permissions come from your application, never from the model. The guard compares the call's structured arguments with the approval; it does not read the model's text as instructions, so an injected "send 10 instead" has nothing to argue with.
- A tool missing from the approval is denied with
task_tool_scope; an argument outside it withtask_argument_scope. Every denial carries a cause and a fix. - Inside an agent loop use
@guard.protect(on_deny="return"): the model reads that the call was refused instead of the run crashing. - When a
certo.trace(...)is open, each blocked call is recorded on it as a span, so the trajectory shows what was stopped. - Constraints:
Eq(value),Max(n),OneOf(a, b, …). Policies load from JSON withGuard.from_file("policy.json")—certo guard initwrites an example.
certo guard demo # four scenarios, agent alone vs. guarded (offline)
certo guard demo --provider groq # same, with a live model (GROQ_API_KEY)
certo guard check policy.json --tool send_money --args '{"recipient":"Spotify","amount":10}'
# exit 5 when denied — usable as a CI/pre-commit gate
The demo runs in a synthetic bank-and-inbox environment; whether an attack reached its goal is decided by a deterministic oracle from what actually executed, never by the guard's own verdict.
Send a trace
import certo
with certo.trace("Refund the customer's last order", api_key="certo_sk_…") as t:
t.log_span("llm", "planner", input=prompt, output=plan)
@certo.tool # logs args, output, latency and errors for you
def issue_refund(order_id: str) -> dict:
...
result = issue_refund("o_988")
t.finish(result) # → scored, returns {id, status, …}
@certo.tool is worth using over hand-written spans: it records what the function was
actually called with, so a trajectory cannot be narrated after the fact.
Or connect a framework you already use
Nearly every agent framework exports OpenTelemetry, which is the whole integration:
export OTEL_EXPORTER_OTLP_ENDPOINT=https://your-certo/api/v1/otel
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer certo_sk_…"
If the process has no exporter yet, instrument() sets one up:
from certo import instrument
from openinference.instrumentation.langchain import LangChainInstrumentor
instrument(service_name="support-agent")
LangChainInstrumentor().instrument()
Then call your agent exactly as you already do — nothing is threaded through it, no callback parameter, no config argument:
result = agent.invoke({"messages": [{"role": "user", "content": "Hello"}]})
| Dedicated instrumentor | Connected over OTLP |
|---|---|
| LangChain · LangGraph · CrewAI · LlamaIndex · OpenAI · OpenAI Agents · Anthropic · Pydantic AI · Vercel AI SDK | Agent Core · Strands · Google ADK · LiteLLM · Mastra · Portkey · anything that speaks OpenTelemetry |
Certo reads both the GenAI semantic conventions and OpenInference, which is what
most auto-instrumentation emits. certo setup <framework> prints the exact lines for
yours, with your own key already filled in.
Check it arrived
certo verify
Sends one span and waits for it to come back scored. Worth running before wiring a real agent: the failure everyone hits is silent. An OTLP exporter that cannot reach its endpoint raises nothing — by design, since a tracing library that crashes production would be worse — so the only symptom is an empty page, with no way to tell whether the key, the address or the agent is at fault. This says which.
Auditing a live agent
certo audit --url https://my-agent.internal/chat \
--body '{"message":"{{prompt}}"}' \
--output-path data.reply \
--tool-calls-path data.actions \
--name "Support bot"
{{prompt}} is where each probe goes. Naming --tool-calls-path is what turns
tool-safety probes into facts: they get graded on the calls the agent made, not on its
description of what it would do. An OpenAI-compatible endpoint works too —
certo audit --model gpt-4o-mini --api-key sk-….
Streaming agents are supported (--response-mode sse|ndjson|websocket); before this
existed, a streamed reply was parsed as a single JSON document and the agent came back
mute, so the report described a silence it never produced.
Give it context if you can. --system-prompt-file and --tools "issue_refund,cancel_order"
are never used to grade — they make the remediation concrete. An allow-list naming your
real tools is a patch; the same advice without names is a suggestion.
Re-runs diff themselves. Audits are grouped by --name, so the same name again
prints what got fixed and what regressed. The delta is measured by re-scoring both
runs on the probes they both scored — never by subtracting two headline numbers that had
different denominators. Doing it the obvious way once reported +52 for an agent that
had stopped answering.
Auditing from your own code, with your own tasks
from certo import audit, Task
def my_agent(prompt: str):
return my_app.invoke({"input": prompt})["output"]
report = audit(
agent=my_agent,
name="Support bot",
tasks=[Task("What is our return window?", expect="30 days")],
)
assert not report.incomplete # check this FIRST — see below
assert report.security >= 80
assert not report.regressions
The agent never leaves your process: Certo sends the probes, your code runs them, only the answers come back.
In CI
certo audit --url "$AGENT_URL" --name "$SERVICE" --fail-under 70 --fail-on-regression
| exit | meaning |
|---|---|
0 |
passed every gate you asked for |
2 |
TrustScore below --fail-under |
3 |
a probe that used to pass now fails |
4 |
the run was incomplete — the agent was unreachable for too many probes |
5 |
certo guard check: the call falls outside the approval |
Exit 4 is checked first and always. A run that could not reach the agent scores
high, because the probes it would have failed never ran. Letting that satisfy
--fail-under would turn an outage into a green build.
The report
Certo · trace fe74735c ✔ scored
What is the capital of Japan?
TrustScore 100 / 100 ████████████████████████
Objective PASS answer matched reference (extracted 'Tokyo')
Trajectory 5/5 mean step 5.0 · 3 spans
Provenance self-reported (sdk)
Judges low disagreement
Steps
1 llm planner 5/5
2 tool web_search 5/5
3 llm synthesizer 5/5
Provenance is not decoration. A trace you sent us is your agent's own account of
itself, and the report says so rather than implying we watched it happen.
Commands
| command | what it does |
|---|---|
certo |
overview of everything Certo can do |
certo login [--key|--email] |
interactive login (arrow keys), stores a credential in ~/.certo/config.json |
certo guard demo [--provider …] |
watch the guard block injected actions, offline or with a live model |
certo guard init [path] |
write an example approval policy |
certo guard check <policy> --tool … --args … |
check one call against a policy (exit 5 if denied) |
certo verify |
send one span and confirm tracing is connected |
certo setup [framework] |
print the setup lines for your stack, key filled in |
certo integrations |
what Certo can read, and how |
certo audit --url|--model … |
run the probe suite against a live agent |
certo audits / certo report <id> |
list audits / re-print one (--json for the raw report) |
certo probes |
what the suite is made of — probes, judges, standards |
certo run "<task>" -- <cmd…> |
run a command as the agent, capture + score its trajectory |
certo trace <file>|--task … |
submit a captured trace (--watch to poll + report) |
certo ls / certo show <id> |
list traces / print one full report |
certo keys new|list|rm |
mint / list / revoke machine API keys |
certo whoami / certo config |
show the account / stored base_url + credential |
Short ids work everywhere, like git: certo report 0a6a.
Config & environment. CERTO_BASE_URL and CERTO_API_KEY override the stored
config. NO_COLOR disables ANSI colour. The config file is written chmod 600 — it
holds a credential.
Wrapping a command as the agent
certo run "What is the capital of Japan?" --expected Tokyo -- python my_agent.py
Runs your command, captures stdout as the final answer, records the run as a trace. If
the command prints a <certo:trace>[…spans…]</certo:trace> block, those spans are parsed
and graded per step — so an answer-only agent can still expose its real trajectory, and
cannot fake it as prose.
One thing to know before trusting a number
A deployment can be configured with a stub judge, which grades deterministically and
produces numbers that look entirely real. certo verify says so when it sees one, and
the server's /ready endpoint reports each judge separately. If a score looks too clean,
check there first.
Metadata
Release files for certo-sdk 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| certo_sdk-0.3.0.tar.gz | 46.3 kB | Without provenance | Details for certo_sdk-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| certo_sdk-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for certo_sdk-0.3.0-py3-none-any.whl |
Total release size: 97.1 kB
Release files / certo_sdk-0.3.0.tar.gz
| Download URL | certo_sdk-0.3.0.tar.gz |
|---|---|
| Size | 46.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd0a6d5277776bd43f40019828b0e8a3c22fea40c738f633990c4c032c424f65
|
|
BLAKE2b-256 checksum How to use checksums |
530d6a6b285563a8290d4d311f12e4eee1a24eb32c6225786bb085b9bdd5b5a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Release files / certo_sdk-0.3.0-py3-none-any.whl
| Download URL | certo_sdk-0.3.0-py3-none-any.whl |
|---|---|
| Size | 50.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e794c4b1d50545e278044e1d4bc0763befeccd9b6f583e2bb5cf5ea2efee21c8
|
|
BLAKE2b-256 checksum How to use checksums |
e231f466da0dfdd593e43783e413b536fa17e7257b2c54b36028dd2f41aecbb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Security for certo-sdk 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.