Repository navigation
fix(evaluations): the graded agent no longer sees who graded it (abilityai/trinity-enterprise#781) - #3936
Conversation
…ityai/trinity-enterprise#781) Evaluation reads project the evaluator through an allowlist: an operator reads the full grader, a machine or non-operator reader gets only the kind. The redaction leaf is byte-identical to the integration branch's, plus a guard that rejects a malformed kind so an address can never ride through the kind field.
dolho
left a comment
There was a problem hiding this comment.
Thanks, this is a clean fix. The two-prefix denylist becomes a single allowlist projection in evaluation_read_service.redact_evaluator, and every read path picks it up through _to_response. I checked that the router is the only place evaluator is read and served on dev, so the fix covers every read path.
Verification on my side: the targeted set passes (172). Reverting only the router turns 77 cases red, and disabling only the kind-grammar guard turns exactly 16 red, which matches your evidence. The new tests drive the real routes and writers rather than pinning source text.
A few small follow-ups, none blocking:
- The body uses
Refs abilityai/trinity-enterprise#781. Please switch toFixes abilityai/trinity-enterprise#781for traceability; ent#781 will still need a manualstatus-in-devafter merge, since it is in the other tracker. - The body still has the draft line "Record ... tracking/disposition before publication." Please file or link an issue for the unredacted
judge/checksdictionaries and replace that line with the reference. - The DEV-ONLY guard depends on whoever merges
feature/agent-behavioral-evalkeeping it. A note on ent#937 or on that branch's PR would make it harder to lose. - For the record: a bare
tier0evaluator now readsunknown. No current writer emits it, so this seems fine.
Approving.
… keep-both (#3936) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
merge-train 2026-10-26: pushed |
…y.json rebuilt from stages (#3946) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts (both sides appended): docs/memory/feature-flows.md (kept both index rows, newest first) and tests/registry.json (kept both; every entry three-way checked). #3936 and #3946 add no route this census sees as a hand-copied self-gate and do not reference the old AGENT_CALLABLE table. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fixes abilityai/trinity-enterprise#781
Evaluation reads expose an admin grader’s username or email to machine principals and shared non-operators. Reuse the evaluation integration branch’s allowlist projection: exact non-person names remain visible, other supported evaluator forms reduce to their kind, and unrecognised bare values become
unknown. Human owners and admins retain the full evaluator through JWT or their own user-scoped key.Storage and write behaviour are unchanged. Adopt the issue regression verbatim, test all three GET routes, and extend the census across statically named calls to the known admin and Workspace writer APIs.
Known limitation: arbitrary admin
judgeandchecksdictionaries retain their current visibility. The evaluation integration branch withholdsjudgefrom machines; it does not generally sanitize arbitrary adminchecks. Record Andrii’s chosen tracking/disposition before publication.Deliberate divergence from the integration branch:
redact_evaluatoradds one marked dev-only guard: a kind is shown only when it is an identity-free token ([a-z0-9_-]+), and anything else readsunknown, so a stored[email protected]:admincannot leak the address as its kind. Whenfeature/agent-behavioral-evalreaches dev, the merge must keep this guard (or carry it into that branch's copy).Merging
feature/agent-behavioral-evalinto dev later:src/backend/routers/evaluations.py, first conflict (imports): keep bothfrom services.agent_service.helpers import accessible_agent_names, narrow_to_agentandfrom services import evaluation_read_service. Dropping the first makes all three GET routes raiseNameError.src/backend/services/evaluation_read_service.py: take the integration copy, then re-insert the# --- DEV-ONLY GUARD (ent#781 security review): begin … endblock (and its_IDENTITY_FREE_KINDregex) immediately afterkind, sep, _ = name.partition(":")inredact_evaluator.tests/unit/test_937_projection.py: take theirs; it is a strict superset of this file.tests/unit/test_937_ent781_census.py: keep this census (four sites, three writer APIs) and add any driver the integration's writers need. Keeptests/unit/test_ent781_read_routes.py.Validation:
test_937_projection,test_937_ent781_census,test_ent781_read_routes,test_ent366_workspace_ratings,test_206_agent_evaluations,test_ent872_fleet_reach,test_ent499_problem_report,test_3521_problem_report_comment): 285 passed underpytest-randomlyseeds 11 and 22. The three new files alone: 115 passed.tests/unit, seed 12345,-m "not slow", before the round-2 guard): 28003 passed, 4 failed, 21 errors. All 25 are pre-existing and environmental, with the same 4 + 21 on a cleandevcopy. The 4 aretest_ent679_payments_pin_parity, where the local venv's package versions are older than the image pins. The 21 are thetest_ec_operator_queue_*fixtures, which require a DB path containingtrinity-unit-tests; with one, those files pass (156 passed)..env, no submodules), seed 12345, on the final tree including the round-2 guard: 27980 passed, 0 failed, 0 errors, includingtest_937_ent781_census23,test_937_projection16,test_ent781_read_routes76 andtest_ent366_workspace_ratings47. Across that cross-branch run the only red is a pre-existing timing flake on unmodifieddev(test_ent879_aauth_resource_route, seed 67890; 8 of 2000 isolated repeats fail), on no branch.tests/lint_sys_modules.pyandtests/lint_root_test_placement.py: OK.Regression evidence (red on clean
dev, before the fix): 56 of 85 behavioural cases fail, every one on the disclosed grader address. No case fails on a 401/404, import or fixture error.test_937_projection.py:test_a_machine_never_learns_which_admin_graded_it2/2 red (AssertionError: admin:[email protected]), andtest_admin_grade_reads_as_the_kind_to_a_non_operator_human1/1 red.test_937_ent781_census.py::test_no_writer_names_its_grader_to_a_machine: 8/16 red (the two admin-writer sites × four machine readers). The 8 workspace/operator cases are green controls.test_ent781_read_routes.py: 45/56 red. That includestest_read_routes_hide_admin_identity9/9, where each GET returns 200 with['admin:[email protected]'].test_every_call_site_has_a_driver) and its 6 negative controls (an unregistered site, a second call in a registered function, a removed site, an empty inventory, malformed source and undecodable source) are green. They are guards, not red evidence.Journey Impact: none — repairs grader visibility on existing evaluation reads; adds no journey or product workflow.