Skip to content

[Feature]: Optional reviewer-facing evidence gates for software-agent actions #4259

Open

Description

@safal207

Is there an existing feature request for this?

  • I have searched existing issues and feature requests, and this is not a duplicate.

Problem or Use Case

OpenHands-style agents can write code, use command lines, browse, and operate in sandboxed environments. The final diff, terminal result, or browser outcome can be reviewed, but it can still be hard to answer a separate reviewer question:

The agent produced an output — but was it allowed to take that action?

This matters for higher-impact software-agent actions such as shell commands, file modifications, workflow/config changes, browser actions, or tool calls where a reviewer may want to see what evidence was checked before the action happened.

The use case is not to replace sandboxing, evals, or code review. It is to add a lightweight reviewer-facing audit artifact that makes agent action decisions easier to inspect and replay.

Proposed Solution

Add an optional reviewer-facing evidence-gate artifact around agent actions.

A possible flow:

agent proposes action
→ optional pre-action evidence gate
→ ALLOW / BLOCK / ESCALATE
→ reviewer-facing stop reasons + checked evidence
→ tool call / shell step / browser action / code change

The artifact could include:

action type,

triggering task,

checked evidence or context fields,

decision: ALLOW / BLOCK / ESCALATE,

stop reason if blocked or escalated,

replayable decision record.

This could start as a lightweight trace/log/export artifact rather than a hard runtime enforcement feature. The goal is to help reviewers inspect why an agent action was considered acceptable, risky, or requiring escalation.

Alternatives Considered

A reviewer can currently inspect the final diff, terminal logs, browser results, or conversation history. Those are useful, but they do not always provide a structured answer to whether the agent had enough evidence or permission to take a specific action.

Other alternatives include custom wrappers, external policy tools, or manual review checklists. The limitation is that they are usually inconsistent, not replayable, and not connected to the actual agent action trace.

Sandboxing, evals, and code review are still important, but they solve a different problem. This proposal is only about an optional reviewer-facing decision artifact around agent actions.

Priority / Severity

Medium - Would improve experience

Estimated Scope

Unknown - Not sure about the technical complexity

Feature Area

Agent / AI behavior

Technical Implementation Ideas (Optional)

A minimal version could start as an optional structured trace event emitted before selected high-impact actions. It does not need to block execution by default. The event could later be exported in logs or displayed in a reviewer UI.

Additional Context

Related experimental project: https://github.com/safal207/pythiaLabs

Example snapshot output:
https://github.com/safal207/pythiaLabs/blob/main/docs/examples/agent-action-audit-snapshot-example.md

Workflow intake template:
https://github.com/safal207/pythiaLabs/blob/main/docs/examples/agent-action-workflow-intake-template.md

PythiaLabs explores deterministic evidence gates for high-risk AI-agent actions and replayable reviewer artifacts. This issue is only a question/proposal about whether a similar optional artifact would be useful around OpenHands-style workflows.

Activity

  1. added
    enhancement
    on Jun 16, 2026
  2. VascoSch92 commented on Jun 17, 2026

    @VascoSch92
    Member

    Thanks for the writeup, @safal207

    Most of the flow you describe already exists in the agent SDK that powers OpenHands:

    Given that, the parts of your request that look genuinely new are:

    1. Tri-state decisions — today the analyzer→policy layer is effectively ALLOW vs. CONFIRM (a bool); BLOCK and ESCALATE are not distinct outcomes. My question is: what is the difference between BLOCK/ESCALATE and CONFIRM? This last one already block the agent and wait for human.
    2. Persisting the gate's rationale as a first-class, exportable field. Can you share a concrete scenario where inspecting the existing trajectory + security analyzer verdict is insufficient?
  3. cschanhniem commented on Jun 18, 2026

    @cschanhniem

    This is a great direction, and what @VascoSch92 describes from the software-agent-sdk is solid. But I think there is an important architectural distinction worth discussing: instructions vs policy.

    Right now the OpenHands approach embeds governance inside the agent runtime — the security analyzer, confirmation policy, and policy rails all live within the agent loop. This means the agent itself decides whether it is acting safely. That is a great instruction layer.

    What AGENTOWNERS (https://github.com/cschanhniem/AGENTOWNERS) explores is the other half: an external, deterministic policy file that declares what agents are allowed to do before the tool call is dispatched. The distinction:

    • AGENTS.md / runtime security → tells agents how to work
    • AGENTOWNERS → defines what they are allowed to do, evaluated deterministically with no LLM in the enforcement path

    For the tri-state decision question (@VascoSch92 asked about BLOCK vs ESCALATE vs CONFIRM), a deterministic policy engine can resolve this cleanly:

    • block → hard deny, no bypass
    • require_approval → escalate to human, wait for signoff
    • allow → proceed

    The priority is always block > require_approval > allow, evaluated against file patterns, action types, and actor identity before the tool call leaves the agent. The nice thing is this is framework-agnostic — it does not matter whether the agent is OpenHands, Claude Code, or Cursor.

    The replayable audit artifact described in the issue is exactly what a deterministic policy evaluation produces: matched rule, decision, evidence, timestamp, zero randomness.

    Happy to discuss how a .agentowners.yml could complement OpenHands runtime security as an external governance layer.

  4. safal207 commented on Jun 18, 2026

    @safal207
    Author

    Thanks @VascoSch92 and @cschanhniem — this distinction is very helpful.

    I agree that OpenHands already has strong runtime security primitives, and that an external deterministic policy layer such as AGENTOWNERS can provide hard authorization boundaries.

    The reviewer-facing gap I am trying to describe is slightly different:

    • runtime analyzer: how risky is the proposed action?
    • deterministic policy: is the action permitted?
    • evidence gate artifact: what concrete evidence was checked, what rule was matched, why the decision was made, and can an independent reviewer replay that decision?

    A concrete example:

    An agent is asked to modify a production deployment workflow and rotate a secret reference.

    The existing trajectory may show:

    • the command,
    • the model reasoning,
    • a HIGH security risk,
    • and that a human confirmed it.

    But a reviewer may still need a structured answer to:

    1. Was the workflow explicitly in scope for this task?
    2. Was the secret value read or only the reference changed?
    3. Was the actor authorized for the production environment?
    4. Which policy or evidence rule caused the action to be allowed or escalated?
    5. Would the same inputs produce the same decision during an audit?

    In this case:

    • BLOCK means a deterministic rule forbids the action and human confirmation cannot override it.
    • ESCALATE / REQUIRE_APPROVAL means the action is potentially valid but requires an authorized reviewer.
    • CONFIRM could remain the OpenHands interaction mechanism used to satisfy that escalation.

    So ESCALATE describes the policy decision, while CONFIRM describes the runtime interaction.

    A minimal implementation could simply emit an optional structured event containing:

    • action identity,
    • matched rule IDs,
    • evidence references,
    • deterministic decision,
    • stop/escalation reason,
    • policy/version hash,
    • timestamp.

    This could complement both OpenHands runtime security and external policy layers without replacing either.

  5. safal207 commented on Jun 18, 2026

    @safal207
    Author

    If this direction seems useful, I can draft a minimal event schema and a small proof-of-concept mapping it onto the existing "ActionEvent" / "ObservationEvent" flow.

    The goal would be to keep it optional and lightweight: no new enforcement engine, just a first-class exportable decision record that reuses the existing OpenHands security primitives.

    Would a schema-first proposal or a small experimental PR be more useful?

  6. safal207 commented on Jun 19, 2026

    @safal207
    Author

    I drafted the schema-first version discussed above and kept it outside
    OpenHands core so the event shape can be reviewed before implementation.

    Interoperability note:
    https://github.com/safal207/pythiaLabs/blob/main/docs/integrations/OPENHANDS_EVIDENCE_GATE_DECISION_EVENT.md

    Draft-07 JSON Schema:
    https://github.com/safal207/pythiaLabs/blob/main/schemas/integrations/openhands_evidence_gate_decision_event.schema.json

    The proposal reuses existing SDK concepts:

    • ActionEvent identity, tool call and summary;
    • ActionEvent.security_risk;
    • stable policy-rail IDs and reasons;
    • confirmation as the runtime interaction used to satisfy ESCALATE.

    It separates:

    policy decision: ALLOW | BLOCK | ESCALATE
    runtime interaction: NONE | DENY | CONFIRM

    The schema also records evidence references, policy version/hash,
    stable stop reasons and replay digests.

    This remains an experimental interoperability proposal only — not an
    OpenHands feature, endorsement, or replacement for its security stack.

  7. Necmttn commented on Jun 21, 2026

    @Necmttn

    Evidence gates should emit receipts tied to the action they authorize. Fields: action id, tool call or command id, checked evidence refs, policy version, decision, stop reason, verifier, and verification command/result if present. That keeps the artifact lightweight while letting reviewers trace from final diff back to the pre-action evidence.


    Generated with ax.

  8. safal207 commented on Jun 21, 2026

    @safal207
    Author

    Системы контроля доказательств должны выдавать квитанции, привязанные к разрешенному ими действию. Поля: идентификатор действия, идентификатор вызова инструмента или команды, ссылки на проверенные доказательства, версия политики, решение, причина остановки, проверяющий и команда/результат проверки, если таковые имеются. Это позволяет сохранить легковесность артефакта и дает возможность рецензентам отслеживать изменения от окончательного сравнения до доказательств, существовавших до выполнения действия.

    Сгенерировано с помощью ax .

    Thanks — I agree that “receipt” is a useful reviewer-facing abstraction.

    Most of the proposed fields already map onto the current draft: action event ID, tool-call ID, evidence references, policy version/hash, decision, and stable stop reasons.

    One implementation detail may be worth keeping explicit:

    • the gate decision is produced before dispatch;
    • verification commands and results only exist after the action executes.

    To preserve an append-only event model, I would avoid mutating the pre-action decision event after execution.

    A minimal structure could therefore use two linked records:

    1. EvidenceGateDecisionEvent

      • action / tool-call identity
      • checked evidence
      • matched rules
      • policy version/hash
      • ALLOW / BLOCK / ESCALATE
      • stop or escalation reason
    2. EvidenceGateVerificationEvent

      • gate event ID
      • action event ID
      • observation event ID
      • verifier identity/version
      • verification command
      • PASS / FAIL / ERROR result
      • result digest

    The exported reviewer “receipt” can be a projection joining these records.

    That would allow a reviewer to trace:

    final diff or observation
    → executed action
    → pre-action decision
    → matched policy and evidence

    without changing the original authorization record after dispatch.

    I can update the experimental schema with this two-phase receipt model and add a concrete OpenHands mapping example.

  9. safal207 commented on Jun 21, 2026

    @safal207
    Author

    Follow-up: the two-phase receipt model discussed above has now been implemented
    as an experimental interoperability protocol in PythiaLabs and merged to main
    via safal207/pythiaLabs#200.

    Canonical note:
    https://github.com/safal207/pythiaLabs/blob/main/docs/integrations/OPENHANDS_EVIDENCE_GATE_DECISION_EVENT.md

    It now includes:

    • EvidenceGateDecisionEvent v0.2 for the pre-action decision;
    • append-only EvidenceGateVerificationEvent for post-action checks;
    • a reviewer-facing EvidenceGateReceipt projection;
    • linked JSON Schemas and examples.

    The key invariant is that post-action verification does not mutate the original
    authorization record. The receipt joins decision, action/observation,
    verification, and final artifacts through stable IDs and digests.

    This remains an experimental interoperability proposal only, not an OpenHands
    feature or endorsement.

  10. anywaypridyrok commented on Jun 24, 2026

    @anywaypridyrok

    Disclosure: I’m building DiffReceipt, a small devtool focused on reviewer-facing evidence for AI-coded changes.

    This issue is very close to the problem we’re working on: not whether an agent can make a change, but whether a reviewer can understand what happened before accepting it.

    A useful evidence gate might include: requested task, allowed scope, changed files, checks executed, check results, rollback boundary, and human-review status. In our experiments, the key is keeping the reviewer view short enough to actually use, while preserving a more detailed developer trail underneath.

    No need to treat this as a product suggestion — mostly sharing the schema angle in case it helps the design here.

  11. rpelevin commented on Jun 24, 2026

    @rpelevin

    Reviewer-facing evidence gates are useful if they stay split from enforcement and from post-action verification.

    For OpenHands, I would keep the optional artifact as a pair of events plus a small projection:

    1. EvidenceGateDecisionEvent: emitted before dispatch, keyed by action id, tool or command id, task id, actor/session id, target refs, args digest, declared scope, checked evidence refs, policy or rail version, decision, reason code, and verifier.
    2. EvidenceGateVerificationEvent: emitted after observation, keyed back to the same decision id and action id, with changed files or browser/tool result refs, checks run, check result summaries, rollback boundary, and any human-review state.
    3. EvidenceGateReceipt: reviewer-facing projection that joins the pre-action decision, the executed action, the verification event, and final artifact refs without rewriting the original decision.

    The key invariant is that the pre-action decision is append-only. A later successful test, final diff, or reviewer acceptance can satisfy verification, but it cannot retroactively create permission for an action that was outside the declared scope when it ran.

    I would pin these tests first:

    1. Allowed file edit inside declared task scope produces a decision event, observation link, verification event, and receipt.
    2. File edit outside declared scope cannot be represented as approved by a later receipt.
    3. Shell command with approval required preserves the exact actor, command digest, task id, and decision id across resume or retry.
    4. Skipped or failed checks are visible in the receipt instead of collapsing into a generic pass.
    5. Human review pending, accepted, rejected, and timed out are distinct terminal states.
    6. Policy or rail version drift between decision and verification is detected, not hidden.
    7. Rollback boundary missing is a receipt defect even if the final diff looks correct.
    8. Post-action verification cannot mutate decision, reason, scope, or evidence refs.

    That gives reviewers a short surface to inspect while preserving a replayable developer trail underneath.

    Boundary: architecture and test feedback only; no claim about using OpenHands or running its code.

  12. arian-gogani commented on Jun 24, 2026

    @arian-gogani

    the reviewer-facing evidence gate is exactly the right primitive — and the property that makes it useful is the same one @safal207's two-phase receipt model captures: the evidence needs to be verifiable by the reviewer independently of OpenHands' infrastructure.

    the concrete gap in most evidence gate implementations: a reviewer receives a diff + result, but the 'approved' record lives in the platform's database. if the platform is unavailable or the record is modified, the reviewer can't verify independently.

    the receipt layer closes this: before the agent executes a command, it emits a signed pre-execution record (decision: ALLOW, action_type: 'shell.exec', scope: 'sandbox'). after execution, it emits a signed outcome record carrying the result digest and the same action_ref. a reviewer holds the public key and verifies both records offline — no OpenHands instance needed.

    action_ref = SHA-256(JCS({agent_id, action_type, scope, timestamp_ms})) is the content-derived join key. computed from the intent fields before execution, so the reviewer can confirm: was the evidence gate cleared for the exact action that ran? if the agent deviated from what was approved, the hashes diverge.

    for OpenHands specifically: the execute_action → observe loop is the natural hook point. receipt before execute_action, receipt after observe. pip install nobulex — bilateral receipt shape in agentrust-io/integrations#6.

  13. transferred this issue fromOpenHands/OpenHandson Jul 27, 2026
  14. all-hands-bot commented on Aug 28, 2026

    @all-hands-bot
    Collaborator

    [Automatic Post]: This issue has had no activity for 29 days (labels: enhancement). @enyst @neubig @xingyaoww, could you take a look when you have a chance and help figure out next steps?

    Generated by OpenHands automation on behalf of the user.

  15. all-hands-bot commented on Oct 6, 2026

    @all-hands-bot
    Collaborator

    [Automatic Post]: This issue has had no activity for 38 days (labels: enhancement). @enyst @neubig @xingyaoww, could you take a look when you have a chance and help figure out next steps?

    Generated by OpenHands automation on behalf of the user.

  16. safal207 commented on Oct 11, 2026

    @safal207
    Author

    Thanks for #5182. I checked the merged behavior at "4cc058275c5a08d845bd846576aafc80e5dd7d0d" and corrected my interoperability note to use "SecurityAnalysisEvent.risks[ActionEvent.id]", keeping the acting model's "ActionEvent.security_risk" label separate.

    One small follow-up: the existing three-action batch test uses identical risks/details and checks only key sets, so it cannot catch value permutations between the correct action IDs. This "one-file native test patch" (https://github.com/safal207/pythiaLabs/blob/a5056d054d88d25aed27a69b88ba256ab0f02923/proofs/openhands-4259-mixed-batch/mixed-batch.patch) strengthens that existing case with LOW/HIGH/MEDIUM risks and distinct detail markers (35 additions, 8 deletions).

    Two isolated controls rotate only risks or only details while preserving the fixture's keys and original policy input. For each, the original test file passes all 11 cases; the strengthened file fails only the intended mixed-batch assertion (10 pass, 1 expected failure). After restoring production, the relevant native suite passes: 491 passed, 7 skipped, 10 xfailed. "Replay and raw evidence" (https://github.com/safal207/pythiaLabs/blob/a5056d054d88d25aed27a69b88ba256ab0f02923/proofs/openhands-4259-mixed-batch/README.md); "fresh native CI" (https://github.com/safal207/pythiaLabs/actions/runs/38120091083).

    Scope is the existing "Agent.step" unit helper with mocked completion and a no-op tool. This is test sensitivity, not an observed production defect or proof of execution/authorization.

    Would a focused tests-only follow-up to #5182 be useful?

  17. arian-gogani commented on Oct 13, 2026

    @arian-gogani

    @safal207 Yes, a focused tests-only follow-up to #5182 would be useful. Please keep the claim scoped to the mixed-batch test: distinct risk and detail values should catch values being associated with the wrong ActionEvent IDs. I agree this is a test-coverage gap, not evidence of a production authorization defect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions