Skip to content

📝 RFC: session taint - track sensitive reads across an agent's tool calls and restrict later outbound actions #18987

Open

Description

@clubanderson

Summary

Hive's content defences are pattern-based: ioscan cleans and matches untrusted text before an agent reads it, plants a per-task canary and scans outbound bodies for it, the push broker rejects an outgoing diff that contains a secret-shaped string, and the proxy gates each write by method, path and mode. Each of these looks at one piece of content at one moment. None of them remembers what the agent has already seen.

That leaves a gap that a paraphrase defeats. An agent that reads something it should not repeat (a secret from a credentialed API response, a file from a private repository, a token in a log) and later makes an outbound action whose payload is clean (a comment, an issue body, a push to a public fork, a network call) is not caught, because the later payload does not match any pattern. The information flow, not the content, is the problem.

This RFC proposes a small, Hive-owned record of what each agent session has read, and a rule that later outbound actions are checked or restricted against that record. It complements pattern scanning; it does not replace it, and it is not an attempt to detect injection.

Problem

Concrete flows the current controls do not cover:

  1. An agent reads an issue or file in a private repository during a task, then posts a summary as a comment on a public repository it also serves. The comment contains no secret-shaped string, so neither ioscan nor the canary fires.
  2. An agent receives a credentialed API response (an inference-gateway response, a cloud CLI call, a read through a brokered token) containing an identifier or key fragment, and later includes a transformed version of it in a PR body.
  3. A planted canary catches verbatim and simply-encoded copies, but the canary only exists for text Hive planted. Real sensitive data that Hive did not plant has no marker.
  4. Prompt injection arrives in a comment, the agent is persuaded to read a sensitive source, and a later step exfiltrates through an allowed channel with reworded content.

What the existing controls do well and must be kept: deterministic checks outside the model, fail-closed behaviour at the proxy, per-agent attribution by UID.

Where it fits today

  • Sources Hive can already see. For backends that route through the Go inference translator (src/crux/proxy/anthropic_translate.go, github_proxy_inference.go), the conversation including tool results passes through Hive. For GitHub, the MITM'd api.github.com traffic (src/crux/proxy/github_proxy_mitm.go) carries responses for reads, and the response for a repository lookup states whether the repository is private. src/crux/logscrub FindSecret already classifies secret-shaped text by category without returning the value.
  • Sinks Hive already mediates. Proxy writes by method and path (src/crux/proxy/rules.go, write_surface_enforce.go), the relays hive-open-pr, hive-open-issue, hive-review, hive-merge, hive-push-branch, and the push broker (src/crux/pushbroker/pushbroker.go), which already scans the outgoing diff and records an effect through effects.Boundary (src/crux/effects). Canary egress inspection is in github_proxy_policy.go inspectCanaryEgress.
  • Identity and scope. The proxy attributes a connection to an agent by UID (procnet.go, github_proxy_identity.go). Sandboxed kicks are one task per workspace, which is a natural session boundary. Long-lived CLI agents have no such boundary today.
  • The existing primitive. The per-task canary is already a one-bit taint ("this marker left the estate"). This RFC generalises it from planted markers to observed reads.

What does not exist: any record of what an agent session has read, any label model, and any sink that consults one.

Proposal sketch

  • Labels. A small closed set, for example secret (a credential-shaped value was seen), private-repo (content from a repository the sink audience cannot read), credentialed-response (a response obtained with a token). Labels are monotonic within a scope: once set, only a session end or an explicit operator action clears them.
  • Scope. Per agent per task for sandboxed kicks. For long-lived agents, per task lease or per conversation turn window (open question).
  • Sources set labels. A source is a Hive observation, never an agent claim: the proxy sees a private repository read; the translator sees a tool result for which FindSecret returns a category; a brokered credential was used. Labels are stored in Hive-owned state the agent cannot read or write.
  • Sinks consult labels. A sink check is a small deterministic rule evaluated at the existing mediation points: for example, a private-repo label blocks comments on repositories outside the labelled repository's audience; a secret label blocks any public write and any push until a human releases it. Outcomes are allow, deny with a machine-readable reason (the agent is told which rule fired so it can reroute), or hold for a human.
  • Report-only first. Every rule starts in a mode that only records what it would have done, as Hive does for other report-before-enforce rollouts, so false positives are measured before anything is blocked.
  • Evidence. Each label set and each sink decision is an audit entry attributed to agent, task and rule, so an operator can answer "why was this refused".

Phased plan

  1. Design and threat model. Choose labels, scope and the sink list. Write the false-positive budget. Decide where state lives. No behaviour change.
  2. Record only. Set labels from the two cheapest sources (translator tool results via FindSecret, private-repo reads at the proxy). Emit audit entries. Dashboard or hivectl shows labels per session. Nothing is blocked.
  3. Report-only rules. Evaluate sink rules at the proxy write path and the push broker and log "would have blocked" with counts per rule.
  4. Enforce, per rule. Turn individual rules on, starting with the one the report data shows is both common and low false-positive. Add an operator release path.
  5. Extend sources and scope. More sources (brokered credential use, cloud CLI responses where visible), long-lived agent scoping, persistence across spoke restarts.

Open questions

  • Visibility. Cloud CLI backends call their providers directly and read local files without Hive seeing the content. For those, which sources are observable at all? Is partial coverage acceptable if the UI states "not covered" per backend rather than implying protection?
  • False positives. A test fixture or documentation that contains a key-shaped string would taint a session and then block legitimate work. What is the budget, and is "restrict" (hold for a human) better than "deny" for the first rules?
  • Scope for long-lived agents. Per task, per turn window, or per conversation? A label that never clears turns one read into a permanent block.
  • Laundering. The model can paraphrase or split what it read. A label survives that by design, but an agent that never sees the source (a different agent, a different session) is outside it. Is cross-agent propagation in scope?
  • Where state lives. Proxy memory is simple but lost on restart; a store shared with effects.Boundary journaling may fit better. What is the integrity story if the spoke restarts mid-task?
  • Interaction with policy. If 📝 RFC: Hive Runtime Guardrails (v7) #12815 (runtime guardrails) or the authorization RFC filed alongside this one lands, should labels be an input to that language instead of a separate rule set?
  • Cost. Scanning every tool result adds work in the inference path; what latency budget applies?

Acceptance criteria for this RFC

  • A decision on the label set, scope and sink list for phase 1.
  • A stated coverage matrix: for each backend, which sources are observable.
  • An agreed false-positive budget and the report-only exit criteria.
  • Phase 2 split into task-sized issues.

Effort: high. This is a design with several open trade-offs, so it is an RFC and not a task.

Related: #12815 (runtime guardrails), #17091 (v7 team policy and audit), #16966 (push broker outgoing diff gate).

Activity

  1. self-assigned this
    on Nov 18, 2026
  2. clubanderson commented on Nov 18, 2026

    @clubanderson
    MemberAuthor

    Claimed by the maintainer: a dispatched agent is working this, one PR to follow. Please do not open a parallel PR.

  3. hivecommons-hive commented on Nov 18, 2026

    @hivecommons-hive
    Contributor

    Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

    PR #19099 covers this issue: #19099

    The PR body says this is partial/non-closing work (Refs/Part of or leave-open wording), so Hive will not add a closing keyword. GitHub will not show its issue-list PR icon without a closing keyword; the stage comment is the link.

  4. clubanderson commented on Nov 18, 2026

    @clubanderson
    MemberAuthor

    Design document merged in #18999: https://github.com/hivecommons/hive/blob/v5/src/docs/design/session-taint.md

    It covers the threat model, what exists today with code citations, the label, source and sink model, fail-closed behaviour, the false-positive budget, an off-by-default phased rollout (observe-only first), what it cannot catch, and 12 open questions. This RFC stays open. Review is welcome, especially on session scope for long-lived agents, the audience model, and the false-positive budget numbers.

  5. added
    hive/partially-addressedA merged PR addressed only part of this issue; remainder still actionable
    stage/010-actionableTriaged; eligible for the hive to pick up
    stage/018-open-for-discussionOpen for discussion: proposal / design issue with no live claim; claimable, no agent work queued
    and removed
    stage/010-actionableTriaged; eligible for the hive to pick up
    on Nov 18, 2026
  6. github-actions commented on Nov 18, 2026

    @github-actions
    Contributor

    PR #18999 has merged (#18999) and referenced this issue with a non-closing Refs #18987 rather than a closing keyword.

    This issue remains open because the merged PR did not use Closes / Fixes / Resolves. If the fix should close it on merge, use a closing keyword in the PR body; use the opt-in hive: needs-confirmation marker only when the reporter genuinely must verify before closure.

  7. clubanderson commented on Nov 18, 2026

    @clubanderson
    MemberAuthor

    Claimed by the maintainer: a dispatched agent is working this, one PR to follow. Please do not open a parallel PR.

  8. added
    hive/verified-openHive verified that a likely/already-done claim did not finish this issue; keep open for more work
    and removed
    stage/018-open-for-discussionOpen for discussion: proposal / design issue with no live claim; claimable, no agent work queued
    on Nov 18, 2026
  9. 32 remaining items

  10. added
    stage/018-open-for-discussionOpen for discussion: proposal / design issue with no live claim; claimable, no agent work queued
    stage/020-claimedClaimed by the scanner or a relay contributor
    stage/stalledIn its current stage longer than expected
    and removed
    stage/018-open-for-discussionOpen for discussion: proposal / design issue with no live claim; claimable, no agent work queued
    stage/020-claimedClaimed by the scanner or a relay contributor
    stage/stalledIn its current stage longer than expected
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

hive/partially-addressedA merged PR addressed only part of this issue; remainder still actionablehive/verified-openHive verified that a likely/already-done claim did not finish this issue; keep open for more workstage/020-claimedClaimed by the scanner or a relay contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions