Repository navigation
Description
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:
- 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
ioscannor the canary fires. - 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.
- 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.
- 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'dapi.github.comtraffic (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/logscrubFindSecretalready 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 relayshive-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 througheffects.Boundary(src/crux/effects). Canary egress inspection is ingithub_proxy_policy.goinspectCanaryEgress. - 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
FindSecretreturns 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-repolabel blocks comments on repositories outside the labelled repository's audience; asecretlabel 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
- Design and threat model. Choose labels, scope and the sink list. Write the false-positive budget. Decide where state lives. No behaviour change.
- Record only. Set labels from the two cheapest sources (translator tool results via
FindSecret, private-repo reads at the proxy). Emit audit entries. Dashboard orhivectlshows labels per session. Nothing is blocked. - Report-only rules. Evaluate sink rules at the proxy write path and the push broker and log "would have blocked" with counts per rule.
- 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.
- 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.Boundaryjournaling 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
clubanderson commentedon Nov 18, 2026
Claimed by the maintainer: a dispatched agent is working this, one PR to follow. Please do not open a parallel PR.
hivecommons-hive commentedon Nov 18, 2026
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 ofor 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.📖 docs(design): session taint design for RFC #18987 (#18999)
clubanderson commentedon Nov 18, 2026
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.
github-actions commentedon Nov 18, 2026
PR #18999 has merged (#18999) and referenced this issue with a non-closing
Refs #18987rather 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-inhive: needs-confirmationmarker only when the reporter genuinely must verify before closure.clubanderson commentedon Nov 18, 2026
Claimed by the maintainer: a dispatched agent is working this, one PR to follow. Please do not open a parallel PR.
32 remaining items