SDK reference · Python SDK

prov.trace.assessments.guard_tool

prov.trace.assessments.guard_tool in Python SDK. Assess action, then run fn only on allow.

Signature

prov.trace.assessments.guard_tool(action: dict, fn: Callable[[], Any], trace_id: Optional[str] = …, agent_id: Optional[str] = …, agent_session_id: Optional[str] = …, run_id: Optional[str] = …, context: Optional[dict] = …, findings: Optional[list] = …, wait_for_approval: Any = …, on_unavailable: Optional[dict] = …, timeout: float = …, idempotency_key: Optional[str] = …) -> Dict[str, Any]

Parameters

actiondictRequired
fnCallable[[], Any]Required
trace_idOptional[str]
agent_idOptional[str]
agent_session_idOptional[str]
run_idOptional[str]
contextOptional[dict]
findingsOptional[list]
wait_for_approvalAny
on_unavailableOptional[dict]
timeoutfloat
idempotency_keyOptional[str]

Returns

Dict[str, Any]

HTTP operation

Runs locally, with no request to the API.

Was this page helpful? Send us feedback

LLM? Read llms.txt.