diff --git a/docs/ADRs/0024-harness-definitions.md b/docs/ADRs/0024-harness-definitions.md index f6035721f3..ff48fd2717 100644 --- a/docs/ADRs/0024-harness-definitions.md +++ b/docs/ADRs/0024-harness-definitions.md @@ -96,6 +96,8 @@ parts: redaction post-tool). Omitting the `security` block enables all scanners with fail-closed semantics. Individual scanners can be toggled off per-harness, but there is no global kill switch. + The actor-attributed source-record admission and per-record authorization + boundary is defined by [ADR 0133](0133-actor-attributed-data-security-boundary.md). 14. **Validation loop** — an optional deterministic script that checks agent output and re-runs the same agent with feedback on failure. The current implementation supports re-running the previous agent with validation diff --git a/docs/ADRs/0098-entity-first-harness-evaluation.md b/docs/ADRs/0098-entity-first-harness-evaluation.md index cdbfab61cc..d0b1f22d0b 100644 --- a/docs/ADRs/0098-entity-first-harness-evaluation.md +++ b/docs/ADRs/0098-entity-first-harness-evaluation.md @@ -122,7 +122,10 @@ state become platform responsibilities. continues to authorize event-backed dispatch from its event actor. A `fullsend poll` entity-discovery run is instead authorized by its trusted Fullsend-controlled origin; callers that cannot establish that provenance are - denied. Entity history remains untrusted input. For each candidate harness, + denied. Entity history remains untrusted input. The separate model-bound + admission contract for filtered, actor-attributed content is defined by [ADR + 0133](0133-actor-attributed-data-security-boundary.md). For + each candidate harness, before evaluating its CEL predicate, the platform MUST enumerate a platform-defined closed superset of action-indicating elements for the entity kind and remove those whose actor's current permission does not meet that diff --git a/docs/ADRs/0133-actor-attributed-data-security-boundary.md b/docs/ADRs/0133-actor-attributed-data-security-boundary.md new file mode 100644 index 0000000000..c45aa78797 --- /dev/null +++ b/docs/ADRs/0133-actor-attributed-data-security-boundary.md @@ -0,0 +1,170 @@ +--- +title: "133. Apply a data security boundary to authorized actor-attributed content" +status: Accepted +relates_to: + - agent-architecture + - security-threat-model +topics: + - authorization + - data-security + - prompt-injection + - events +--- + +# 133. Apply a data security boundary to authorized actor-attributed content + +Date: 2026-10-07 + +## Status + +Accepted + +## Context + +[ADR 0054](0054-require-authorization-on-all-agent-dispatch-paths.md) decides +which actors are eligible to cause agent processing. [ADR +0107](0107-bot-identity-resolution-for-dispatch-authorization.md) extends that +decision to provider-resolved bot identities. [ADR +0098](0098-entity-first-harness-evaluation.md) gives trusted Fullsend +invocation provenance authority to discover entities, while requiring each +action-indicating entity record to meet its actor's current permission +threshold. These decisions establish authorization and provenance for deciding +whether processing may begin; they do not make the text produced by an +authorized actor truthful, safe, or authoritative. + +Agents nevertheless need to use actor-attributed data such as issue bodies, +comments, reviews, and linked records. The boundary applies only to records +whose source system can reliably establish the record and actor attribution, +and for which Fullsend can obtain current authorization from the applicable +trusted authorization provider. That provider may be the source system's +permission subsystem or a configured provider recognized by [ADR +0054](0054-require-authorization-on-all-agent-dispatch-paths.md) and [ADR +0107](0107-bot-identity-resolution-for-dispatch-authorization.md), including +OWNERS-derived permissions and registered-bot roles. GitHub pull request or +issue comments and Jira issue comments are representative records. Self- +asserted author or committer metadata is not sufficient; records whose actor +cannot be reliably established are redacted. That data may arrive in the +triggering event, a poll or snapshot, or a proactive read through another +authorized API. Comments from an authorized actor can contain genuine task +instructions that the agent must be able to heed. The boundary must still +prevent content from changing platform authority or capabilities, and must +protect against hidden Unicode, prompt injection, and indirect disclosure. + +## Decision + +Fullsend separates three decisions: whether a source actor is authorized for +the relevant processing path, whether source content may be admitted as data or +task guidance, and which fixed platform instructions and capabilities the model +receives. + +Authorization under [ADR 0054](0054-require-authorization-on-all-agent-dispatch-paths.md) +and [ADR 0107](0107-bot-identity-resolution-for-dispatch-authorization.md), or +the trusted discovery provenance in [ADR +0098](0098-entity-first-harness-evaluation.md), permits actor-attributed +content to be considered for data admission, regardless of whether the +content was delivered by an event, polling, a snapshot, a proactive API read, +or a model-facing retrieval capability. Discovery provenance authorizes finding +the entity; it does not authorize the entity's content. + +Authorization is per source-system record and uses that record's actor. The +actor who updates a change proposal may differ from the actor who wrote a +comment on it, so the latter's authorization is evaluated independently. The +checked actor is the principal authenticated by the source system as having +produced the exact current content revision: the creator for a never-edited +record, or the latest authenticated editor when the source system records an +edit. An event sender, poller, or retrieval credential never substitutes for +that revision actor. If the source system cannot establish attribution for the +current revision, the record is redacted. The actor's applicable permission or +recognized role MUST be co-fetched in the +same authoritative API response, delivered in the same verified event payload, +or lazily resolved from the authoritative source when first needed. A lazy +result MAY be cached only for the logical lifetime of the containing event or +entity structure and agent invocation. The cache lifetime and the required +fresh checks between admission and model exposure are defined by the +[Authorization Contract v1](../normative/authorization/v1/README.md). +The actor MUST meet the applicable observation or mutation threshold for the +selected harness. For a human actor, this means the applicable current forge +permission threshold. For a bot actor, whose `actor.role` remains `none`, a +fresh provider-backed exact `actor.bot_role` recognition under ADR 0107 +satisfies this gate; the ordinary `actor.role` threshold does not apply. CEL or +harness routing may further restrict a recognized bot role, but cannot +authorize an unrecognized bot. An unrecognized or unresolved bot role fails +closed and the record is redacted. A label grant authorizes only its verified +label transition; it does not authorize unrelated content from that actor or +other actors. + +Event-carried permission or role evidence may support initial event admission +and routing, but it MUST NOT satisfy later model-bound authorization checks. +Fullsend MUST apply the fresh authorization checks defined by the Authorization +Contract before model admission and at later model-exposure checkpoints. +Failure, unavailability, or loss of authorization at a check redacts the +record and, if no authorized records remain, denies the run. + +This is bounded trust: content with authorized provenance may inform analysis +and, where the harness permits, provide task instructions. It cannot grant +platform authority or become a source of credentials, identity, permissions, +routing, harness configuration, or capabilities. Unrecognized, unauthorized, +unattributed, ambiguous, or unverifiable source-system records are redacted +before model admission; there is no data-only fallback for them. + +Before any selected actor-attributed content reaches a model, the host-side +input boundary MUST verify its source-system record, actor attribution, actor +authorization, and bounds and apply the versioned content-filtering pipeline. +The pipeline MUST perform Unicode and control-character safety handling +(including hidden and bidirectional characters), sensitive-data and secret +redaction, prompt-injection scanning, and size limits. The model may receive +only the resulting filtered representation, with explicit data delimitation and +any bounded omission or finding metadata. Raw source content and rejected or +unauthorized content MUST NOT be exposed to the model or retained in ordinary +run artifacts. + +Filtering is fail-closed for missing or unverifiable provenance, missing or +failed actor authorization, detector failure or timeout, and content that the +active policy cannot safely represent. +A blocking finding produces an omission or quarantine record rather than raw +model input; the filter manifest records the disposition, digest, and bounded +diagnostics without retaining the rejected body. The exact character policy, +detector versions, dispositions, and compatibility rules belong in the +versioned content-filter contract shared by all model-bound data paths. + +The model-facing prompt MUST preserve the provenance and boundary of filtered +source-system records relative to system/developer instructions and +harness-provided task instructions. Content from an authorized actor MAY guide +task execution within the configured harness scope, including by requesting an +otherwise permitted change. An authorized record is one trusted text unit for +this boundary: quoted, forwarded, or copied text inside that record is not +assigned a separate trust level, and the entire filtered record text is +admitted under the record actor's authorization. Separate linked records still +require their own attribution and authorization. Content from a redacted +source is absent from the model context. No source content may re-dispatch the +agent or elevate its identity, permissions, tools, capabilities, or +platform-owned instructions. +The platform's pre-dispatch command parser and deterministic, schema-validated +host/post-script paths remain the only paths that select a stage or perform a +forge mutation. + +This is a target contract. At the time of this ADR, the complete boundary is +not enforced on every model-bound path; existing adapters and runtimes retain +their compatibility behavior until they adopt the common attribution, +authorization, filtering, and redaction contract. + +Fullsend-controlled retrieval capabilities are part of this target boundary +and MUST return source-system records with the same attribution, +authorization, filtering, and redaction guarantees. This ADR does not govern +model-initiated or agent-authored direct source-system calls; those calls may +still occur outside this boundary. Future ADRs may define mechanisms that +encourage models to prefer platform-originated data that passes this boundary +or apply additional filtering to model-originated retrievals. + +## Consequences + +- Authorized contributors and recognized bots can provide useful context and task guidance, regardless of how the data is retrieved, without gaining platform authority. +- The strict per-record threshold means that external contributors whose current source authorization is below the selected harness threshold may have their descriptions or comments redacted even when a maintainer's event authorizes observation; preserving community review of that content is a likely follow-up ADR. +- Every forge adapter, poller, snapshot builder, proactive data source, and Fullsend-controlled model retrieval capability needs provenance binding, per-record authorization, bounded retrieval, and the common filtering pipeline before its content is model-visible. +- Fresh authorization at admission and later model-exposure checkpoints adds source-system API load and latency. Implementations may coalesce contiguous checks and cache per actor only within the logical lifetime defined by the Authorization Contract. +- Hidden-character and prompt-injection findings may omit legitimate-looking content, so the model and operators need bounded diagnostics rather than an assumption that all source text will be preserved. +- Filtering reduces, but cannot prove the absence of prompt injection; immutable instructions, least privilege, output validation, and deterministic host-side mutations remain required defenses. +- Quoted, forwarded, or copied text is intentionally not detected or assigned a separate trust level inside an authorized record. A trusted actor or bot can therefore relay hostile text as part of a trusted record; this residual risk is accepted in exchange for a whole-record admission model, and is mitigated by trusted-actor caution, filtering, explicit delimitation, least privilege, output validation, deterministic host-side mutations, and the fresh authorization checkpoints. +- Any harness that admits an authorized record as task guidance MUST keep that guidance within its configured scope and enforce least privilege, output validation, and deterministic host-side mutation rules; the whole-record rule does not authorize a new stage, capability, provider, or separate source-system record. +- Direct model-initiated source-system calls remain outside this ADR's guarantee. A future ADR may define ways to encourage use of platform-originated, checked data or add filtering for model-originated retrievals. +- The data-filter contract becomes a versioned security boundary whose changes require compatibility review and regression testing across all model-bound data consumers. diff --git a/docs/architecture.md b/docs/architecture.md index ce8363159a..0d956d5f81 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -391,6 +391,16 @@ The existing design principle is that [the repo is the coordinator](problems/age non-label paths ([ADR 0107](ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md); [Authorization Contract v1](normative/authorization/v1/); [ADR 0054](ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md)). +- Data security boundary (target state): each source-system record is admitted + only when its actor attribution and current authorization meet the selected + harness threshold, regardless of whether it arrives through an event or a + proactive API read; unrecognized or unauthorized content is redacted. + Host-side filtering removes hidden characters, redacts sensitive data, scans + for prompt injection, and applies size limits before filtered, + provenance-labelled content reaches the model. This ADR does not govern + model-initiated direct source-system calls; future ADRs may encourage use of + platform-originated checked data or add filtering for model-originated + retrievals ([ADR 0133](ADRs/0133-actor-attributed-data-security-boundary.md)). - Poll entity-discovery authorization: `fullsend poll` has no prompting event actor; verified, non-user-assertable Fullsend invocation provenance authorizes entity enumeration and evaluation, and callers without it are denied. Before diff --git a/docs/normative/authorization/v1/README.md b/docs/normative/authorization/v1/README.md index 5c459ba5b7..0d58ff6f54 100644 --- a/docs/normative/authorization/v1/README.md +++ b/docs/normative/authorization/v1/README.md @@ -308,8 +308,50 @@ Fullsend MUST omit or minimize other unneeded untrusted fields where the normalized entity contract permits, while retaining the state, content, and actor provenance required by the harness. Further trust or injection filtering MAY run after CEL routing and before the harness pre-script. Retained content -remains untrusted throughout. Any resulting agent run uses the harness's -configured identity and permissions. +remains untrusted for dispatch and CEL evaluation throughout. [ADR 0133](../../../ADRs/0133-actor-attributed-data-security-boundary.md) +defines the separate model-bound admission gate: only filtered content whose +source record and current actor authorization satisfy that ADR may be exposed +to the model under bounded harness scope. Any resulting agent run uses the +harness's configured identity and permissions. + +## Model-bound actor-attributed data admission + +The model-bound gate applies to every source-system record that Fullsend may +expose to a model, regardless of whether the record arrived in an event, was +found by polling or snapshotting, or was read through a proactive or +Fullsend-controlled API. Fullsend MUST establish the record's current actor +attribution through the source system and resolve that actor's current +authorization against the applicable observation or mutation threshold. If +attribution or authorization cannot be established, or the actor does not meet +the threshold, the record MUST be redacted; there is no data-only fallback. + +The actor authorization MAY be co-fetched with the record, supplied in the +same verified event payload, or lazily resolved when first needed. A lazy +result MAY be cached only for the logical lifetime of the containing event or +entity structure and agent invocation. Re-reading or re-fetching the data, +creating a new structure for retry or requeue, or terminating and re-invoking +the agent ends that lifetime and requires fresh resolution, even if the same +in-memory structure is reused. The cache lifetime is not extended by object +identity or by retaining the structure. + +Event-carried authorization evidence MAY support event admission and routing, +but MUST NOT satisfy model-bound checks. Event-triggered runs MUST resolve +record-actor authorization after event admission and before model admission, +again immediately before sandbox initialization, and again immediately before +first model exposure. If sandbox initialization and first exposure are +contiguous, one fresh check MAY serve both. Non-event retrieval paths MUST +perform the equivalent checks after retrieval admission. A +Fullsend-controlled capability invoked after sandbox initialization MUST +resolve authorization immediately before releasing each result to the model. +That release check is the mid-run equivalent of the sandbox checkpoints. + +A cache entry MUST NOT cross any checkpoint. Implementations MAY coalesce +contiguous checks and MAY batch or cache lookups for multiple records from the +same actor, provided the cache remains within this logical lifetime. Failure, +unavailability, or loss of authorization at any checkpoint MUST redact the +record and, if no authorized records remain, deny the run. Revocation after +first exposure cannot retract content already present in the model context, +but every later retrieval result requires its own release check. ## Excluded fields diff --git a/docs/problems/agent-architecture.md b/docs/problems/agent-architecture.md index 6accf3ba1b..141ac6ee2d 100644 --- a/docs/problems/agent-architecture.md +++ b/docs/problems/agent-architecture.md @@ -51,7 +51,7 @@ Writes code to address an issue. This is the most mature capability of current A - **Authority:** Create branches, push commits, open PRs - **Does not have:** Merge authority, ability to approve its own PRs -- **Defensive behavior:** Treats all PR comments (review feedback, change requests, suggestions) as potentially adversarial input, regardless of the commenter's apparent identity. Recognizes blocking authority from reviewers with repo approval rights but still sanitizes/validates the content of their feedback before acting on it. +- **Defensive behavior:** Treats all PR comments (review feedback, change requests, suggestions) as potentially adversarial input, regardless of the commenter's apparent identity. Recognizes blocking authority from reviewers with repo approval rights but still sanitizes/validates the content of their feedback before acting on it, using the actor-attributed data boundary in [ADR 0133](../ADRs/0133-actor-attributed-data-security-boundary.md). ### Review sub-agents diff --git a/docs/problems/security-threat-model.md b/docs/problems/security-threat-model.md index 465a329da2..0cd38da66f 100644 --- a/docs/problems/security-threat-model.md +++ b/docs/problems/security-threat-model.md @@ -96,11 +96,17 @@ In fullsend's architecture, this is mitigated by several design decisions: agent ### Open questions - Can prompt injection be reliably detected? Current research suggests it's fundamentally hard. -- Should we treat all PR content as untrusted, even from org members? (Relates to insider threat.) +- ~~Should we treat all PR content as untrusted, even from org members? (Relates + to insider threat.)~~ Content from actors admitted by the dispatch/data policy + may provide task instructions within the configured harness scope; + attribution does not grant platform authority, and content from + unrecognized or unauthorized actors is redacted, regardless of whether the + source arrived through an event or an API ([ADR + 0133](../ADRs/0133-actor-attributed-data-security-boundary.md)). - How do we handle the case where legitimate code contains text that looks like prompt injection? (e.g., a test for prompt injection defenses) - What's the blast radius if an injection succeeds? How do we limit it? (Credential exposure mitigated by keeping credentials out of sandboxes entirely — see [ADR 0017](../ADRs/0017-credential-isolation-for-sandboxed-agents.md); model-provider credentials for runtimes that need one follow the same rule through a run-scoped provider and a placeholder the agent never resolves — see [ADR 0092](../ADRs/0092-openai-wif-credential-delivery.md) and, for codex, [ADR 0099](../ADRs/0099-codex-agent-runtime.md); an inference gateway that accepts the job's OIDC token keeps reusable provider keys off the forge, though the gateway itself becomes a concentrated risk — see [ADR 0137](../ADRs/0137-inference-gateway-credential-route.md); a gateway that cannot trust forge OIDC can instead take an opt-in API key, which relies on a long-lived secret held by the forge — see [ADR 0138](../ADRs/0138-inference-gateway-api-key-credential-mode.md); the Actions workflow token used for GitHub Packages has its *placeholder* bound the same way, resolving only at the two registry hosts; but a value recovered through the registry's error echo is the job's own `GITHUB_TOKEN` and is replayable against whatever hosts the running role's forge profile already allows — read-write for `coder` — see [ADR 0114](../ADRs/0114-github-packages-via-host-bound-workflow-token-provider.md). Tool access limited by `permissions.deny` hard-blocks — see [ADR 0027](../ADRs/0027-allowed-and-disallowed-tools-for-agents.md). Other blast radius dimensions remain open.) -- Should agents operate on Unicode-normalized text with non-rendering characters stripped, or on raw text with a separate detection pass? Stripping at ingestion is simpler but risks breaking legitimate internationalized content. A detection pass preserves the original but requires every agent to handle invisible content correctly. -- How do we handle invisible Unicode in code itself (source files, not just metadata)? Some non-rendering characters are legitimate in string literals for internationalization. What heuristics distinguish malicious use from legitimate use? +- Should agents operate on Unicode-normalized text with non-rendering characters stripped, or on raw text with a separate detection pass? ([ADR 0133](../ADRs/0133-actor-attributed-data-security-boundary.md) decides that model-bound source content is the filtered representation and that raw text is never exposed; strip versus detect-and-preserve remains deferred to the versioned content-filter contract.) +- How do we handle invisible Unicode in code itself (source files, not just metadata)? Some non-rendering characters are legitimate in string literals for internationalization. What heuristics distinguish malicious use from legitimate use? [ADR 0133](../ADRs/0133-actor-attributed-data-security-boundary.md) defines the source-content boundary; code-content handling remains open. ## Threat 2: Insider threat / compromised credentials