Major: remove is_safe and confidence from evaluation models
Summary
- In a future major version, remove
EvaluationResponse.is_safe, top-levelEvaluationResponse.confidence, and per-controlEvaluatorResult.confidence. - Evaluation responses should expose the actual evaluation artifacts:
matches,errors,non_matches, andreason. - Enforcement code should derive allow/block/steer behavior directly from matches, errors, control actions, and
on_evaluation_error, rather than reading a precomputed boolean or confidence score.
Motivation
- Agent Control evaluation is fundamentally about control outcomes:
- which controls matched
- which controls failed
- which controls did not match
- which actions are attached to matched controls (
deny,steer,observe)
is_safeis derived state, not source-of-truth state. It compresses control actions, evaluator errors, fail-open/fail-closed policy, and SDK/server merge behavior into one boolean.- Top-level
confidenceis not a clear confidence concept. The current value is a mixture of:- full confidence for deny matches
- zero confidence for deny errors
- proportional successful/evaluated controls otherwise
min(local, server)when merging SDK-local and server evaluations
- Per-control
EvaluatorResult.confidenceis also not consistently meaningful. Most deterministic evaluators return fixed1.0/0.0values, while classifier-style evaluators may use it as a score. That creates a shared field whose semantics vary by evaluator. - Keeping these confidence fields risks misleading API consumers into treating them as calibrated probabilities.
- Removing these fields forces clients to reason from explicit evaluation results instead of ambiguous summary numbers.
Current behavior
models/src/agent_control_models/evaluation.pydefines:EvaluationResponse.is_safe: boolEvaluationResponse.confidence: float
models/src/agent_control_models/controls.pydefines:EvaluatorResult.confidence: float
- The engine computes
is_safefrom matched deny/steer controls and deny-control errors inengine/src/agent_control_engine/core.py. - The engine computes top-level
confidenceinengine/src/agent_control_engine/core.pyusing successful/evaluated counts and special deny/error cases. - Composite condition confidence is derived from child evaluator confidence in
engine/src/agent_control_engine/core.py, even though many evaluator confidence values are fixed or non-calibrated. - The Python SDK currently uses
is_safein several enforcement paths:- local/server merge:
sdks/python/src/agent_control/evaluation.py - local-first short-circuiting:
sdks/python/src/agent_control/evaluation.py - framework integration enforcement:
sdks/python/src/agent_control/integrations/_core.py - decorator dict response handling:
sdks/python/src/agent_control/control_decorators.py
- local/server merge:
- The Python SDK mostly carries confidence through, exposes
EvaluationResult.is_confident(...), logs confidence, and merges local/server confidence withmin(...). - Observability stores control-event confidence and aggregates
avg_confidence, so this change affects event schemas and stats too.
Expected behavior
- Evaluation models should no longer include:
EvaluationResponse.is_safeEvaluationResponse.confidenceEvaluatorResult.confidence
- The response should contain explicit evaluation artifacts only, for example:
{
"reason": null,
"matches": [],
"errors": [],
"non_matches": []
}
- Each
ControlMatch.resultshould describe whether that specific evaluator matched, failed, and what metadata/message it returned, without a required confidence score. - Consumers that need an allow/block decision should derive it from:
matcheserrors- each control action
- control-level
on_evaluation_errorfrom issue https://github.com/agentcontrol/agent-control/issues/199
- Consumers that need evaluator-specific scores should carry those scores in evaluator-specific metadata with evaluator-specific naming, not in a universal
confidencefield.
Reproduction (if bug)
- Inspect
engine/src/agent_control_engine/core.pyconfidence calculation. - Observe that top-level
confidenceis not model confidence; it is mostly an evaluation-success ratio with special cases. - Inspect built-in deterministic evaluators and observe that most
EvaluatorResult.confidencevalues are fixed values rather than calibrated scores. - Inspect SDK enforcement paths and observe that
is_safeis used as a convenience decision gate even though the underlying response already containsmatches,errors, and actions.
Proposed solution (optional)
- Remove
is_safeandconfidencefromEvaluationResponseandEvaluationResultin the next major version. - Remove
confidencefromEvaluatorResultand allControlMatch.resultpayloads. - Remove composite-confidence calculation from the engine.
- Remove
EvaluationResult.__bool__or redefine it only after a separate explicit design decision; do not silently preservebool(result)as an alias for removedis_safe. - Remove
EvaluationResult.is_confident(...). - Update all evaluator implementations to stop returning
confidence. - For evaluator-specific scores that remain useful, move them into evaluator metadata with explicit names, such as:
scorerisk_scoreclassifier_score- provider-specific raw score fields
- Update Python SDK enforcement to derive behavior directly:
- blocking
denymatch -> raiseControlViolationError - blocking
steermatch -> raiseControlSteerError - blocking evaluation error -> raise generic control-evaluation failure
- non-blocking fail-open error -> keep visible in
errors, do not block - observe matches -> log/emit observability only
- blocking
- Update local/server merge to merge
matches,errors, andnon_matches, then derive enforcement from the merged artifacts rather than computinglocal.is_safe and server.is_safe. - Update SDK decorator/integration paths to stop depending on response-level
is_safeor confidence. - Update observability event models and stats to remove or replace
confidence/avg_confidence. - Update TypeScript SDK generated models after the OpenAPI schema changes.
Additional context
- Related control-level evaluator failure policy issue: https://github.com/agentcontrol/agent-control/issues/199
- Related control model refactor issue: https://github.com/agentcontrol/agent-control/issues/200
- Relevant files:
models/src/agent_control_models/evaluation.pymodels/src/agent_control_models/controls.pymodels/src/agent_control_models/observability.pyengine/src/agent_control_engine/core.pysdks/python/src/agent_control/evaluation.pysdks/python/src/agent_control/integrations/_core.pysdks/python/src/agent_control/control_decorators.pysdks/python/src/agent_control/evaluation_events.pyserver/src/agent_control_server/observability/store/postgres.py
- This is a major-version API cleanup and should not be folded into smaller evaluator PRs.
This is the right direction. Removing is_safe and confidence in favor of explicit evaluation artifacts (matches, errors, non_matches, reason) aligns with a core governance principle: the enforcement decision must be derived from explicit, inspectable state, not a compressed boolean.
The issue describes exactly why compressed booleans are dangerous in control systems:
is_safeconflates deny matches, evaluator errors, fail-open/fail-closed policy, and merge behavior into a single bitconfidencemixes success ratios with fixed values from deterministic evaluators, making it meaningless as a calibrated score
From the AGENTOWNERS perspective, the rule priority invariant block > require_approval > allow is explicit and inspectable:
- Collect all matching rules
- Sort by priority
- Highest-priority decision wins
- Record: matched rule ID, decision, evidence, reason
There is no is_safe boolean — the decision is the matched rule with the highest priority. If no rule matches, the default (fail-closed: require_approval) applies. Audit the output: same inputs → same output, every time.
One thing worth preserving from the current model: the on_evaluation_error policy (#199). When an evaluator fails at runtime, the behavior (fail-open vs fail-closed) should be configurable per-control, not hardcoded into a boolean. This is already in scope per your proposal — just flagging it as a critical complement to removing is_safe.
The steer action is also interesting. In a deterministic policy model, steer is an output action (like require_approval) not a confidence modifier. The difference between deny and steer is whether the agent gets feedback to retry or just gets blocked — that is a policy decision, not a confidence score.
Removing a comforting but ambiguous safety signal can be the most responsible choice. A boolean like "safe" or a confidence score invites people to stop asking what actually happened, what was checked, and where the uncertainty lives.
I'm building MartinLoop around replacing vague assurances with a run record a human can inspect. A coding agent should not earn trust because a dashboard says it is confident. It should earn trust because the run had limits, produced evidence, passed verification, and made its failure mode explicit when it did not.
Curious what you think the replacement language should be for users who still need a fast decision. MartinLoop is open source at https://github.com/Keesan12/martin-loop. Feedback is welcome at [email protected].