Skip to content

idea: risk-tiered confirmation flag for do-mode writes — inspired by OpenHands' LLMSecurityAnalyzer risk classification #846

Description

@github-actions

Research brief

Landscape survey (2026-07-25), scoped to: "agent_mesh roadmap & comparable OSS
agent frameworks" (OpenHands, SWE-agent, Aider, MetaGPT/ChatDev, Renovate,
claude-code-action).

Landscape signal — OpenHands' graduated risk confirmation. OpenHands' SDK
ships an LLMSecurityAnalyzer that rates every proposed tool call
LOW/MEDIUM/HIGH/UNKNOWN risk; a ConfirmRisky() policy auto-executes
low-risk actions but transitions the run to a WAITING_FOR_CONFIRMATION
state for medium/high-risk ones until a human approves or rejects (a
rejection feeds explanatory context back so the agent retries safely).
Source (fetched, verified): https://docs.openhands.dev/sdk/guides/security

Gap (confirmed against this repo, not just landscape-inspired)

do-mode write confinement today is a flat, binary boundary: the
PreToolUse path-guard hook (hooks/path-guard.js) allows any write inside
AGENT_MESH_ROOT and denies anything outside it — see
src/path-guard.js/src/config.js WRITE_TOOLS. There is no graduated
signal between "inside the root, fine" and "outside the root, denied." A
worker deleting/rewriting a large fraction of the tree, touching a
secret-looking path (.env, credentials.json, a lockfile), or performing
an unusually broad multi-file edit is treated identically to a single
one-line doc fix, as long as both stay inside the writable root. Nothing in
src/delegate.js classifies how risky a write looks before letting the
result finalize as status: done.

This is a different axis from every open security-tagged idea already in the
backlog:

None of these classify the content/blast-radius of an individual write
call
at the moment it happens and route only the risky ones for human
review before the Task is considered final. That's the OpenHands gap.

Proposed direction

Because agent_mesh's do-mode spawn is a one-shot, non-interactive
claude -p run (there is no live human-in-the-loop channel mid-spawn, unlike
OpenHands' synchronous agent loop), the adaptation should stay consistent
with this repo's existing async, review-first model rather than blocking
execution:

  • An optional per-peer agent.json x-agentmesh.riskyWritePatterns (or a
    small built-in heuristic set: N+ files touched in one task, a path
    matching common secret/lockfile globs, a Write to a previously
    non-existent large binary, etc.) evaluated after the do-mode spawn
    completes, using the same files_changed data src/change-detect.js
    already computes — no new hook, no new spawn-time gate.
  • A match does not block or retry anything (same "failure is data, not an
    exception" invariant as timeout/refused/error): it surfaces a new
    structured field (e.g. agentmesh/risk: { level, reasons }) on the Task
    result, and — reusing the existing review-first session/dashboard
    machinery (src/session-provenance.js, the Task Board view) — a
    needs-human-confirm marker so a risky-but-completed write is flagged for
    review before a caller/board treats it as fully accepted, instead of
    silently landing with the same status as a trivial edit.
  • Purely additive: omitting the manifest field preserves today's behavior
    exactly (no risk field emitted).

Invariants preserved

  • Single writable root: unaffected — the path-guard boundary is
    unchanged; this only classifies writes that already happened inside the
    root.
  • Anti-spoof: risk classification reads only files_changed (already
    framework-computed) and the peer's own manifest — never tool-call args.
  • Failure is data: a risky write is still status: done with an
    additional advisory field, never auto-blocked/auto-reverted.

Scope hint

src/change-detect.js (reuse files_changed), src/delegate.js (post-spawn
classification hook), src/config.js (heuristic defaults), src/a2a/protocol.js
(new agentmesh/risk metadata field, additive), pure unit tests only.

Sources

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedBlocked on a dependencygenerated:analystAnalyst agent–generated improvement idea (analyst-daily-review)needs-humansecurityspec:draftSpec being drafted

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions