Skip to main content
Glama

privacy_selftest

Run a local privacy self-test on an AI agent trace; get a JSON verdict with findings and concrete fixes, then rerun until it passes.

Instructions

Test YOURSELF for privacy leaks and get one JSON document back: passed, verdict, risk_index, per-channel status, redacted findings with fingerprints, ordered next_steps with concrete fix objects, delta versus your previous self-test, and the exact rerun. Call it with the trace of a run you just made (inline trace, a trace_path, or coding-agent steps), fix next_steps[0], then call it again until passed is true. passed=true means no finding from the detection tiers listed, not that you are safe or compliant. Runs locally; nothing is sent anywhere.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "privacy_selftest"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepsNoRecorded action/observation steps of a coding or computer-use agent: [{"action": "write_file", "path": ..., "content": ...}, {"action": "run", "command": ..., "observation": ...}, {"action": "finish", "content": ...}].
traceNoThe run to score, inline. Any of: an AgentLeak trace {"events": [...]}; a list of AgentLeak events; OpenAI chat messages; OpenAI Responses / Agents SDK items (result.to_input_list()); Claude Code transcript records (list of JSONL objects); OTLP JSON spans ({"resourceSpans": ...}) using OpenTelemetry GenAI or OpenInference attributes. The format is detected and reported.
fail_onNoFail when a finding is at or above this level: L1, L2, L3 (default) or L4.L3
code_pathNoAlso statically scan this source path (inside the server root).
trace_pathNoPath to a trace file or a directory of .json/.jsonl traces, inside the server root. Use instead of `trace`.
trace_formatNoSkip detection: agentleak_trace, agentleak_events, openai_chat, openai_responses, claude_code, otel_genai, otel_openinference, agent_steps.
record_historyNoRecord this result locally so the next call reports `delta` (new / fixed findings).
scenario_instanceNoinstance_id from privacy_get_scenario, to match that scenario's planted canaries exactly. Defaults to the trace's scenario_id.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.20.1

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations it discloses three behaviors that matter: the tool runs locally with nothing sent anywhere, results are recorded so the next call reports delta, and passed=true is scoped to the listed detection tiers rather than a safety or compliance guarantee. That limitation note is exactly the kind of caveat an agent would otherwise over-trust; it also explains the readOnlyHint=false implication (local history writes) consistently with the record_history parameter.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the outcome (the returned JSON document) and then the workflow, with no filler sentences. It is dense and long-ish, but every clause carries information an agent needs; a little more sentence-breaking would improve scanability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an eight-parameter tool with multiple trace input modes, the description covers what comes back, how to iterate, and the key caveat about what a pass does and does not mean. With an output schema present and annotations covering the side-effect profile, nothing essential is missing before invoking it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the per-parameter descriptions already carry the meaning, including the accepted trace formats and the L1–L4 fail_on levels. The prose adds only a light gloss on the input modes ("inline trace, a trace_path, or coding-agent steps") and otherwise defers to the schema, which is the correct baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ("Test YOURSELF for privacy leaks") and enumerates the exact shape of the result document (passed, verdict, risk_index, per-channel status, findings with fingerprints, next_steps, delta, rerun). It stops short of naming which sibling to use instead, so an agent can't distinguish it from privacy_check_trace purely from this text.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a concrete usage loop: call with the trace of a run you just made (inline trace, trace_path, or steps), fix next_steps[0], then call again until passed is true. That is clear context plus an explicit stopping condition. It offers no exclusion against alternatives such as privacy_scan_code or privacy_check_trace, and doesn't say when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.