SDK reference · Python SDK

prov.trace

prov.trace in the Python SDK: 7 methods. Trace.

Methods

compare

prov.trace.compare(a: str, b: str, pattern: Optional[str] = …) -> Any

Two runs of one prompt side by side (canary + activation delta).

Calls GET /v1/trace/compare.

health

prov.trace.health() -> Any

Calls GET /v1/trace/health.

check

prov.trace.check(trace_id: str, thresholds: Optional[dict] = …, session: Optional[dict] = …, max_age_s: Optional[int] = …, predict: Optional[list] = …, explain: Optional[str] = …) -> Any

Allow | flag | block for a hosted traced inference or a sidecar reading, decided by the account's Trace rules at stage completion.

Calls POST /v1/trace/check.

assess

prov.trace.assess(**params: Any = …) -> Any

Assess an agent's action before it runs (POST /v1/trace/assessments); the raw call under guard_tool.

guard_tool

prov.trace.guard_tool(action: dict, fn: Any, **opts: Any = …) -> Any

Assess action and run fn only on allow; when Provenance can't answer, pay, send and delete never run, write is blocked and read runs unchecked (on_unavailable changes the last two).

guard

prov.trace.guard(fn: Any, thresholds: Optional[dict] = …, session: Optional[dict] = …, preflight: Optional[bool] = …, predict: Optional[list] = …) -> Any

Wrap fn so it only sees a completion the account's Trace rules let through.

models

prov.trace.models() -> Any

Public models + this account's private registry builds.

Calls GET /v1/trace/models.

Was this page helpful? Send us feedback

LLM? Read llms.txt.