Skip to main content

Parameters

EvaluationMetadata

Pick the field that matches how the call’s arguments are structured:
  • MCP, Claude Agent: input={...} — the dict the tool was invoked with.
  • LangChain: args=[...], kwargs={...} — positional and keyword.
  • Raw SDK: whatever shape your tools take.
These flow into the policy evaluator’s request as input.<key>, args.<index>, kwargs.<key> respectively.

Returns: EvaluationResult

For decision == "allow" with no policy matching, all the matched* fields are None. For deny, the matched rule’s id becomes code and its description becomes reason.

Examples

Plain

With input

The policy can match on input.command:

With trace

The trace is uploaded to Rubric and the returned traceId is attached to the audit event. See Traces.

Performance

Synchronous portion (returns to caller):
  • Pure-Python evaluator: ~50–200µs.
  • Native (Rust) evaluator: ~5–20µs (pip install rubric-app[runtime]).
  • DLP scan: ~50µs (regex), ~1ms (Presidio).
  • Trace upload (if attached): 2–5ms.
Asynchronous (does not block the caller):
  • Audit event flush: batched, runs every 1s or every 100 events.

Error handling

evaluate() does not raise. If anything goes wrong internally, you get an EvaluationResult(decision="allow", ...) and the error is logged. This is deliberate — a misconfigured Rubric should never block your agent. To enforce default-deny, set spec.defaultEffect: deny in your policy.