From c15469081e03be6d833de255a357eee3f67c8c76 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Sun, 22 Nov 2026 19:02:34 +0100 Subject: [PATCH 01/14] docs: name related work as prior art (decision D21) D21 refines D17: open specifications and vendor-neutral foundation projects may be named as sources of ideas, not as dependencies. Spec v1alpha3 section 1.2 and the README name the Open Workflow Specification and agent-sandbox; AEP-0022 names the for task of the Open Workflow Specification as prior art. Signed-off-by: Simon Lauger --- CHANGELOG.md | 1 + README.md | 4 ++++ aep/0022-step-iteration.md | 4 +++- docs/decisions.md | 24 ++++++++++++++++++++++-- spec/v1alpha3/README.md | 14 ++++++++++++++ 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fa202d..00c4993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ API versions (`v1alpha1`, ...) are versioned separately, see [GOVERNANCE.md](GOV ### Added +- Decision D21 (refines D17): open specifications and vendor-neutral foundation projects may be named as prior art, not as dependencies. Spec `v1alpha3` section 1.2 and the README name the Open Workflow Specification and agent-sandbox as related work; AEP-0022 names the `for` task of the Open Workflow Specification as prior art. - Decision D20: the Kubernetes resource model draft of pull request #16 becomes `v1alpha3` and starts from `v1alpha2`; the 5-day discussion period is waived for it. `v1alpha3` has step iteration as section 5.6.5, combined with the step output interface: each item run produces its outputs through `$AWP_OUTPUTS` or `complete_step`, command steps get `AWP_FOREACH_INDEX`, an output referenced by `forEach.items` is parsed as a JSON array, and `forEach` is not allowed on input steps (section 14.2 lists the changes from `v1alpha2`). - Conformance suite for `v1alpha2` (`conformance/v1alpha2/`): the `v1alpha1` cases with apiVersion `v1alpha2` plus the step iteration cases; the `v1alpha3` suite has the step iteration cases too. `awp-check.mjs migrate` also converts `v1alpha2` manifests. - Website: `v1alpha3` as a proposed draft next to `v1alpha1` and `v1alpha2`. diff --git a/README.md b/README.md index 1a3a01c..363cdef 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,10 @@ AWP complements existing protocols instead of replacing them: | A2A | Agent ↔ agent communication | | AWP | Definition, governance, execution and audit of agentic workflows | +AWP also takes ideas from the [Open Workflow Specification](https://github.com/serverlessworkflow/specification) +(control flow of workflows) and [agent-sandbox](https://agent-sandbox.sigs.k8s.io/) (isolated +execution of agent code on Kubernetes), without depending on them. + A minimal manifest: ```yaml diff --git a/aep/0022-step-iteration.md b/aep/0022-step-iteration.md index 1b5b264..38ef2d1 100644 --- a/aep/0022-step-iteration.md +++ b/aep/0022-step-iteration.md @@ -39,7 +39,9 @@ to do this, all of them poor: [extension prefix list](../docs/registry/extension-prefixes.md)). Prior art: CI systems (job matrices), workflow engines (map states, dynamic task mapping) and at -least one agent runtime built against `v1alpha1` (as an extension field). All of them bound the +least one agent runtime built against `v1alpha1` (as an extension field). The `for` task of the +[Open Workflow Specification](https://github.com/serverlessworkflow/specification) (`in`, `each`, +`at`, `while`) is the closest specification counterpart (named under D21). All of them bound the fan-out and give each element its own retries; none of them lets a model decide how many iterations run. diff --git a/docs/decisions.md b/docs/decisions.md index 6728771..b843678 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -2,8 +2,8 @@ | | | | --- | --- | -| **Status** | Record of the project owner's decisions. D1 and D2 change how this repository works. All other decisions set the direction of AEPs that are still in `Draft` or `Review`; they do not accept any AEP and do not change `v1alpha1`, except D19, which accepts AEP-0022 and starts the `v1alpha2` draft, and D20, which adds the `v1alpha3` draft and fixes the `v1alpha1` approval step schema. | -| **Decided** | 2026-10-10 (D1-D12, D16), 2026-11-18 (D17, D18) and 2026-11-19 (D19, D20) by the project lead | +| **Status** | Record of the project owner's decisions. D1 and D2 change how this repository works. All other decisions set the direction of AEPs that are still in `Draft` or `Review`; they do not accept any AEP and do not change `v1alpha1`, except D19, which accepts AEP-0022 and starts the `v1alpha2` draft, and D20, which adds the `v1alpha3` draft and fixes the `v1alpha1` approval step schema. D21 refines D17. | +| **Decided** | 2026-10-10 (D1-D12, D16), 2026-11-18 (D17, D18), 2026-11-19 (D19, D20) and 2026-11-22 (D21) by the project lead | | **Related** | [AEP process](aep-process.md), [extension prefix list](registry/extension-prefixes.md), [GOVERNANCE.md](../GOVERNANCE.md) | > Context. AWP is alpha. The owner allows the schema to change where implementation practice shows @@ -180,6 +180,8 @@ a single implementation and were removed from this log by D17. - **Applied in**: this log, `README.md`, `GOVERNANCE.md`, `SECURITY.md`, `CODE_OF_CONDUCT.md`, `docs/aep-process.md`, `docs/site-plan.md`, `docs/registry/extension-prefixes.md`, `aep/0001` to `aep/0011`, `site/`. +- **Refined by**: D21 (open specifications and vendor-neutral foundation projects may be named as + prior art). ### D18. Implementation experience goes into AEPs and implementer guidance @@ -232,6 +234,24 @@ a single implementation and were removed from this log by D17. `schema/awp.v1alpha2.json`, `spec/v1alpha2/` (5.2 note, example), `conformance/`, `aep/0015` to `aep/0022`, `docs/v1alpha3-review-guide.md`, `spec/README.md`, `README.md`, `site/`. +### D21. Open specifications and foundation projects may be named as prior art + +- **Question**: D17 says the AEPs describe prior art without naming products. May the + specification and the AEPs name related open specifications and open-source projects that AWP + takes ideas from, such as the Open Workflow Specification or a Kubernetes SIG project? +- **Decision**: yes, as sources of ideas and inspiration, not as dependencies. The repository may + name open specifications and standards (as it already names MCP, A2A, CloudEvents and the + Gateway API) and vendor-neutral open-source projects hosted by a foundation or a Kubernetes SIG, + where AWP borrows a concept or wording. It still names no runtime, product or vendor offering + outside the implementations list (D17). A named project creates no normative reference: AWP + stays complete without it, and conformance never requires it. +- **Consequence**: spec `v1alpha3` section 1.2 and the README get a related-work paragraph naming + the Open Workflow Specification (control flow of workflows) and agent-sandbox (isolated + execution of agent code on Kubernetes). AEPs name such projects in their prior-art text where + they borrow from them: AEP-0022 (iteration), and the drafts for event triggers and step + isolation. +- **Applied in**: this log, `spec/v1alpha3/README.md`, `README.md`, `aep/0022-step-iteration.md`. + ## 2. Resulting scope of `v1alpha2` | AEP | Title | Target | Reason | diff --git a/spec/v1alpha3/README.md b/spec/v1alpha3/README.md index 24cd851..254765a 100644 --- a/spec/v1alpha3/README.md +++ b/spec/v1alpha3/README.md @@ -83,6 +83,20 @@ AWP does not replace MCP or A2A. A manifest references MCP servers as tool sourc ([section 5.5](#55-tools-and-action-identifiers)) and A2A endpoints as remote agents ([section 5.4.4](#544-remote-agents-a2a)). The wire protocols themselves are out of scope. +Related work (informative). AWP takes ideas from, but does not depend on: + +- the [Open Workflow Specification](https://github.com/serverlessworkflow/specification) (CNCF, + formerly Serverless Workflow), a DSL for the control flow of workflows (`call`, `do`, `for`, + `fork`, `listen`, `emit`, `try`, `wait`) with CloudEvents for events. It describes what a + workflow does in which order; AWP describes what an agent in a workflow may do (models, tools, + permissions, network, secrets) and how that is governed and audited. Where both cover the same + ground, such as iteration ([section 5.6.5](#565-iteration)) and event triggers, AWP aligns its + wording where it can; +- [agent-sandbox](https://agent-sandbox.sigs.k8s.io/) (Kubernetes SIG Apps), a Kubernetes API for + isolated, stateful execution environments for agents, with templates, warm pools and isolation + backends selected by runtime class. It is one way a platform can isolate steps; AWP states what + must be isolated, not how. + ### 1.3 Non-goals AWP does not define: From 08a484c87250ac1183d6544bcde7b7aaff62be21 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Sun, 22 Nov 2026 19:03:43 +0100 Subject: [PATCH 02/14] docs: link the Open Workflow Specification under its new organisation The repository moved from serverlessworkflow to open-workflow-specification. Signed-off-by: Simon Lauger --- README.md | 2 +- aep/0022-step-iteration.md | 2 +- spec/v1alpha3/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 363cdef..93dda5e 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ AWP complements existing protocols instead of replacing them: | A2A | Agent ↔ agent communication | | AWP | Definition, governance, execution and audit of agentic workflows | -AWP also takes ideas from the [Open Workflow Specification](https://github.com/serverlessworkflow/specification) +AWP also takes ideas from the [Open Workflow Specification](https://github.com/open-workflow-specification/specification) (control flow of workflows) and [agent-sandbox](https://agent-sandbox.sigs.k8s.io/) (isolated execution of agent code on Kubernetes), without depending on them. diff --git a/aep/0022-step-iteration.md b/aep/0022-step-iteration.md index 38ef2d1..d1cc321 100644 --- a/aep/0022-step-iteration.md +++ b/aep/0022-step-iteration.md @@ -40,7 +40,7 @@ to do this, all of them poor: Prior art: CI systems (job matrices), workflow engines (map states, dynamic task mapping) and at least one agent runtime built against `v1alpha1` (as an extension field). The `for` task of the -[Open Workflow Specification](https://github.com/serverlessworkflow/specification) (`in`, `each`, +[Open Workflow Specification](https://github.com/open-workflow-specification/specification) (`in`, `each`, `at`, `while`) is the closest specification counterpart (named under D21). All of them bound the fan-out and give each element its own retries; none of them lets a model decide how many iterations run. diff --git a/spec/v1alpha3/README.md b/spec/v1alpha3/README.md index 254765a..ae705c8 100644 --- a/spec/v1alpha3/README.md +++ b/spec/v1alpha3/README.md @@ -85,7 +85,7 @@ AWP does not replace MCP or A2A. A manifest references MCP servers as tool sourc Related work (informative). AWP takes ideas from, but does not depend on: -- the [Open Workflow Specification](https://github.com/serverlessworkflow/specification) (CNCF, +- the [Open Workflow Specification](https://github.com/open-workflow-specification/specification) (CNCF, formerly Serverless Workflow), a DSL for the control flow of workflows (`call`, `do`, `for`, `fork`, `listen`, `emit`, `try`, `wait`) with CloudEvents for events. It describes what a workflow does in which order; AWP describes what an agent in a workflow may do (models, tools, From 4b5491464c3c9d2fc1e83a4c566b26d148270603 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Sun, 22 Nov 2026 01:24:33 +0100 Subject: [PATCH 03/14] docs: runtime feedback G41 to G61 with target AEPs and evidence Event triggers (G41 to G46), the concept review (G48 to G58) and models (G59 to G61). Each entry names the AEP it belongs to; G44 is raised to must because approval rules on the initiator do not bind a person who starts a run by message. Questions 8 and 9 record the decided AEP cut. Signed-off-by: Simon Lauger --- docs/runtime-feedback.md | 70 +++++++++++++++++++++++++++++++---- docs/v1alpha3-review-guide.md | 4 +- 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/docs/runtime-feedback.md b/docs/runtime-feedback.md index d650dee..3d8f37a 100644 --- a/docs/runtime-feedback.md +++ b/docs/runtime-feedback.md @@ -3,7 +3,7 @@ | | | | --- | --- | | **Status** | Working list for discussion. Nothing here is decided; an entry changes the specification only through an AEP ([decision D18](decisions.md#d18-implementation-experience-goes-into-aeps-and-implementer-guidance)). | -| **Source** | A Kubernetes runtime proof of concept (operator, step runner, one real workflow) built against `v1alpha3` at commit `d1bc49b`. As decided in D17, the runtime is not named. | +| **Source** | A Kubernetes runtime proof of concept (operator, step runner, one real workflow) built against the draft at commit `d1bc49b` (then named `v1alpha2`, now `v1alpha3`, decision D20). As decided in D17, the runtime is not named. | | **Collected** | 2026-11-19 | | **Related** | [decision log](decisions.md), [AEP process](aep-process.md), [spec v1alpha3](../spec/v1alpha3/README.md) | @@ -26,15 +26,18 @@ portable runtimes, **should** needs a rule, **minor** is editorial or informativ 5. [Trust and data flow](#5-trust-and-data-flow) 6. [Minor](#6-minor) 7. [From the operator](#7-from-the-operator) -8. [Questions for the project lead](#8-questions-for-the-project-lead) +8. [Event triggers](#8-event-triggers) +9. [From the concept review](#9-from-the-concept-review) +10. [Questions for the project lead](#10-questions-for-the-project-lead) ## 1. Status overview | Status | Entries | | --- | --- | | AEP drafted and applied to the `v1alpha3` draft (Draft, not accepted) | G01, G07, G08, G40; partly G14, G15 | -| Covered by an existing AEP that is not applied yet | G02, G04, G06, G22 | -| Open, needs a decision whether and how | G03, G05, G09, G10, G11, G12, G13, G16 to G21, G23 to G39, K | +| AEP drafted, not applied | G10, G47, G49, G50, G51, G61 (AEP-0023); G42 to G46, G54, G56 (AEP-0024); G03, G53, G58 (AEP-0025) | +| Covered by an existing AEP that is not applied yet | G02, G04, G06, G22; G41 (AEP-0004); G48, G57 (AEP-0019 open question 1); G52 (AEP-0021); G55 (AEP-0012); G59, G60 (AEP-0008) | +| Open, needs a decision whether and how | G05, G09, G11, G12, G13, G16 to G21, G23 to G39, K | ## 2. Step interface @@ -42,7 +45,7 @@ portable runtimes, **should** needs a rule, **minor** is editorial or informativ | --- | --- | --- | --- | --- | | G01 | must | How a step produces its declared outputs is undefined; command images and agent prompts only work on the runtime they were written for. | Command steps write files to `$AWP_OUTPUTS`; agent steps get a completion mechanism. | AEP drafted: [step outputs](../aep/0018-step-outputs.md), spec 5.6.4; open question 4 there: non-string values in `complete_step` as JSON until AEP-0003 | | G02 | must | Outputs are untyped: a runtime cannot ask the model for structured output or check it before the next step. | `outputs[].type` and `schema`. | [AEP-0003](../aep/0003-typed-handoffs.md) and [AEP-0014](../aep/0014-input-examples-and-schemas.md), not applied | -| G03 | must | No state across executions ("already reported"). Solved with a volume from the runtime binding, invisible to AWP: no data class, no retention. | `spec.state` (name, classification, retention), provided as a directory or key-value store. | open | +| G03 | must | No state across executions ("already reported"). Solved with a volume from the runtime binding, invisible to AWP: no data class, no retention. | `spec.state` (name, classification, retention), provided as a directory or key-value store. | AEP drafted: [AEP-0025](../aep/0025-state.md) | | G05 | must | Secrets of command steps are too coarse: `scope: [command]` gives a secret to every command step; the variable name is undefined. | Step ids as `scope` entries; a secret is exposed as an environment variable with its name. | open | | G12 | should | Where the code of a command step comes from is undefined (scripts in the image; an example runs `npm test` without a checkout). | `workspace` (for example a Git repository and revision) or explicitly implementation-defined. | open | | G14 | should | No size limit for outputs. | A minimum every runtime accepts and a rule for larger outputs. | in AEP-0018 (256 KiB per output, 1 MiB per step) | @@ -73,7 +76,7 @@ portable runtimes, **should** needs a rule, **minor** is editorial or informativ | --- | --- | --- | --- | --- | | G07 | must | No execution object and no status shape; `kubectl get workflows` cannot show validity. | A run kind; standard conditions in `metav1.Condition` shape with printer columns. | AEP drafted: [WorkflowRun and status](../aep/0019-workflow-run-and-status.md), spec 3.11 and 10.8 | | G09 | should | Unknown `spec` fields pass `kubectl apply --validate=strict` (the CRDs keep unknown fields); only `status` shows the error, and GitOps tools report "synced". | Ship the validator as an admission webhook image or a ValidatingAdmissionPolicy for common rules. | open; the `Valid` condition of G07 makes the error visible in `kubectl get` | -| G10 | should | Host-based network permissions cannot be enforced with NetworkPolicy. | Informative note: egress proxy or FQDN policies of the network plugin, otherwise a declared limitation. | open | +| G10 | should | Host-based network permissions cannot be enforced with NetworkPolicy. | Informative note: egress proxy or FQDN policies of the network plugin, otherwise a declared limitation. | AEP drafted: [AEP-0023](../aep/0023-step-isolation.md) | | G26 | should | `metadata.namespace` and `secrets[].source: kubernetes` tie a manifest to one runtime. | Namespace is deployment data; `source` names an abstract store that the runtime resolves. | open | | K | should | No mapping of AWP concepts to Kubernetes primitives; every Kubernetes runtime invents its own. | A mapping table in spec 3.10, see below. | open | @@ -136,8 +139,54 @@ the collector only works because a command step now parses structured sources de | G38 | minor | `maxDuration` on an agent is ambiguous when the agent serves several steps; the runtime rejects it. | Only workflow and step level, or cumulative step time. | open | | G39 | should | Runtime neutrality has only been tested on Kubernetes. The `WorkflowRun` draft defines conditions as `metav1.Condition` and names an admission webhook as the source of the actor. Related to G26. | Define conditions as plain JSON (`type`, `status`, `reason`, `message`, `lastTransitionTime`) with `metav1.Condition` as the Kubernetes mapping; keep "actor from an authenticated source" normative and the webhook as a non-normative example; mark Kubernetes-only text as informative. A run of the same workflow without a cluster is planned. | open | | G40 | should | Command step `image`: what a runtime without containers does with it (ignoring it runs the command in an unreviewed environment), and whether digests are needed. Digests made Helm charts hard to maintain, and digests of single platforms break multi-architecture use. | A runtime that cannot run the image rejects the workflow; tags are allowed outside the security profile and resolved to the image index digest at start, pinned for the execution and recorded. | applied in the AEP-0020 draft (spec 5.6.2, 9.4, 10.1, 10.7) | +| G47 | should | `permissions.network` and deployment limits: a namespace network policy also restricts egress, and the spec says neither who enforces `allowHosts` nor what happens when the deployment allows less. The default `egress: allow` also conflicts with deny-by-default deployments. | The manifest states what the workflow needs, the deployment sets a ceiling, the intersection applies (like a pod security context under a cluster security policy). The runtime MUST enforce, MAY restrict further and MUST reject before execution if the ceiling is narrower or it cannot enforce for a step type. `egress: deny` as the default under the security profile. | AEP drafted: [AEP-0023](../aep/0023-step-isolation.md) | -## 8. Questions for the project lead +## 8. Event triggers + +Reported while the same runtime added event-driven workflows: a chat bridge publishes messages as +CloudEvents to an MQTT broker, an existing event router (one listener per transport, one filter +object per workflow) creates a run for every matching workflow, and a step answers in the +originating thread. Routing involves no model, so a message cannot redirect it by prompt. Two +findings from the router used: it subscribes to MQTT with QoS 0 and keeps event ids for +deduplication only in memory for a few minutes, so the runtime must deduplicate itself. + +| ID | Sev. | Gap | Proposal from the runtime | Status | +| --- | --- | --- | --- | --- | +| G41 | must | An event trigger cannot pass event data to the execution; spec 5.2 has no event context, so the proof of concept maps event fields to inputs. | Apply AEP-0004 (`${{ event.* }}`, `dataSchema`, `classification`, event data as untrusted input) to `v1alpha3`, keeping D7. The run object carries the event as set by the router (G48); a test or replay run carries a supplied event (G57). | partly solved: D7 and AEP-0004 replace the input mapping; AEP-0004 not applied to the draft yet | +| G42 | should | `filter` semantics are undefined: which fields it matches, whether by equality, how entries combine. | Keys are CloudEvents attribute names or `data.`, values match by equality, all entries must match. Richer conditions (CEL, expression filters) live in an implementation-specific trigger object attached with `targetRefs` (AEP-0021 B6) and may only narrow the manifest filter. | AEP drafted: [AEP-0024](../aep/0024-event-triggers.md) | +| G43 | should | No duplicate handling and no concurrency for event triggers; MQTT and webhook retries deliver events more than once. | Deduplicate by CloudEvents `source` and `id` within a window the runtime states; allow `concurrencyPolicy` and a rate limit on event triggers. | AEP drafted: [AEP-0024](../aep/0024-event-triggers.md); duplicates observed in the proof of concept (a run rejected as duplicate event), the runtime deduplicates by `source` and `id` | +| G44 | must | The actor of an event-triggered execution is unclear: the authenticated party is the bridge, not the person who wrote the message. | Record both: the authenticated source and an optional actor attested by it; policies may require an attested actor and name the sources allowed to attest. Answers never count as approvals (AEP-0017). | AEP drafted: [AEP-0024](../aep/0024-event-triggers.md); severity raised: approval rules on the initiator (spec 7.6 `initiatorCannotApprove`, `actorCannotApproveOwnAction`) do not bind a person who starts a run by message while the actor is `system`. Evidence: the bridge attests the author only through transport authorisation (broker access control), not end to end | +| G45 | minor | No reply path: an execution started by a message cannot refer to where the message came from. | Standardise correlation data in the event context (thread, reply target as a CloudEvents extension); delivery stays with steps. | AEP drafted: [AEP-0024](../aep/0024-event-triggers.md) | +| G46 | should | Conversation context: a reply in a thread (chat, ticket, mail) only sees the triggering message. The proof of concept lets the source adapter attach earlier thread messages (author, bot flag, time, text; capped, with a truncation flag) and the participants to the event data. | A standard shape for thread context inside `event.data` (AEP-0004), untrusted and classified like the rest, so workflows stay independent of the source. Participants are personal data and fall under the data policy. | AEP drafted: [AEP-0024](../aep/0024-event-triggers.md); limits in the proof of concept are set, not measured | + +## 9. From the concept review + +Found while writing a reference concept for operating agents and in three reviews of it against +the proof of concept and the draft at `b8a0ee8` (now `v1alpha3`, decision D20). The column "Home" names the AEP or entry where a +change would fit. + +| ID | Sev. | Gap | Proposal from the runtime | Home | Status | +| --- | --- | --- | --- | --- | --- | +| G48 | must | Event runs created by an external router (an event router creating run objects) fit neither role of spec 10.8: client-created runs are manual, runtime-created runs record the trigger only in status, and the run spec has no trigger. | A trusted-ingress role: an authenticated identity the runtime accepts may create runs with trigger type `event` and an event payload; the runtime checks the trigger against the manifest, records the ingress identity and rejects event fields from other creators. | AEP-0019 open question 1 | open; the runtime now plans to create event runs itself from a generated trigger object, which needs no new role; the role stays relevant for external routers | +| G49 | should | `permissions.network.allowHosts` has no syntax: subdomain wildcards, ports, IP literals and CIDRs are undefined. | Define host matching (exact, `*.domain`), optional ports, and whether addresses or CIDRs are allowed. | [AEP-0023](../aep/0023-step-isolation.md) | AEP drafted | +| G50 | must | An allowed host can resolve to loopback, private, link-local (cloud metadata) or CGNAT addresses (SSRF, DNS rebinding); the proof of concept had this hole. | Under the security profile, deny such destinations after resolution unless listed explicitly as addresses. | [AEP-0023](../aep/0023-step-isolation.md) | AEP drafted; the proof of concept now checks the resolved address at connection time (covers rebinding and redirects by construction), without an explicit rebinding test | +| G51 | should | No guidance on how `permissions.network` is enforced for command steps. | Informative: a per-workload egress proxy with an allowlist derived from `allowHosts`, plus a network policy that allows only that proxy, is conforming. A runtime that cannot enforce a network rule rejects the workflow. | [AEP-0023](../aep/0023-step-isolation.md), with G10 | AEP drafted | +| G52 | should | AEP-0021 B6 covers bindings but not runtime trigger objects (routing, expression filters, rate limits). | Trigger objects attach with `targetRefs` and `sectionName` (trigger index), may only narrow the manifest trigger, are generated from or validated against `spec.triggers`, and report `Accepted`. | AEP-0021 (extend B6) | open | +| G53 | should | Two workflows of one owner share state (a daily run writes, a chat run reads and writes). | State as a named resource referenced by several workflows with an access mode, rules for concurrent writers, and the strictest classification for every reader. | [AEP-0025](../aep/0025-state.md), with G03 | AEP drafted; scenario derived, no conflict observed | +| G54 | minor | Meaning of `triggers[].source`: the CloudEvents producer (URI) or an adapter name (AEP-0021 B4). | State which one. | [AEP-0024](../aep/0024-event-triggers.md); AEP-0021 B4 corrected | AEP drafted | +| G55 | should | A step that posts as its own bot account acts under an external identity; the manifest shows only a secret, and governance sees `shell.execute` (G06). | Declare the external identity a step acts as, so audit and policies can refer to it. | AEP-0012 (its open point on which identity calls a tool) | open | +| G56 | minor | Event routers can silently weaken delivery guarantees (one subscribes to MQTT with QoS 0). | Runtimes state the delivery guarantee per event source in the conformance statement. | [AEP-0024](../aep/0024-event-triggers.md) (conformance statement) | AEP drafted | +| G57 | should | Event-only workflows cannot be tested conformingly: AEP-0004 fails `event.*` outside event runs, and 10.8 makes client runs manual. | A client run with a supplied event, marked as test or replay (actor is the creator), validated against `dataSchema`. | AEP-0019 open question 1, AEP-0004 | open | +| G58 | should | State written by one execution is read as data by the next, so a message or web page can become a persistent instruction (memory poisoning, seen in the chat workflow). | Origin marking (G11) also for state; state is untrusted input by default. | [AEP-0025](../aep/0025-state.md); spec 12 now lists state as untrusted input | AEP drafted | +| G59 | should | AEP-0008 treats `contextTokens` and `maxOutputTokens` as informative; a model server rejected every request because the runtime asked for more output tokens than the model allows. | Catalog limits are binding: the runtime caps requested output tokens at `maxOutputTokens` and rejects a workflow whose settings cannot fit. A price of 0 (local models) counts as a known price (G35). | AEP-0008 (its target `v1alpha3` predates D20 and now means after the current draft), with G34 | open | +| G60 | minor | Agent steps need a model that supports tool calls; a small local model called tools without arguments, and the failure showed only at run time. | Optional capability flags in the catalog model entry (`toolUse`, `structuredOutput`); a runtime rejects an agent with tools on a model without tool support. | AEP-0008 | open | +| G61 | should | The spec does not say where model credentials live; a runtime may hand the provider key to the step, where any command or injected instruction can read it. | Under the security profile, model credentials MUST NOT be visible in the step environment; the runtime calls the provider itself or through a proxy that authenticates the step with a short-lived, execution-bound credential. | [AEP-0023](../aep/0023-step-isolation.md); not AEP-0008, whose non-goals exclude credentials | AEP drafted; feasibility shown (key only at the runtime, short-lived credential per attempt), latency and cost of the proxy not measured | + +**Conflict in the draft (G44).** Spec 5.2 gives every `event` start the actor type `system`, +while G44 asks to record a person attested by the event source. Both cannot hold; 10.8 avoids +the question only because runtime-created runs record the trigger in status. + +## 10. Questions for the project lead 1. Do the three drafted AEPs (G01, G07, G08) join the `v1alpha3` scope table in the decision log, once they reach `Review`? @@ -151,3 +200,10 @@ the collector only works because a command step now parses structured sources de `v1alpha3` or later? The real run above makes G24/G34 the most pressing of them. 7. G27 to G38 are mostly clarifications. Collect them in one AEP (like AEP-0013) or extend AEP-0013? +8. Decided 2026-11-22: event triggers get one AEP, [AEP-0024](../aep/0024-event-triggers.md) + (G42 to G46, G54, G56). G41 is AEP-0004, G48 and G57 go into AEP-0019 (open question 1), G52 + into AEP-0021. +9. Decided 2026-11-22: network permissions and credentials get one AEP, + [AEP-0023](../aep/0023-step-isolation.md) (G10, G47, G49 to G51, G61). Internal destinations + are denied by default under the security profile, not banned: the manifest and the platform + ceiling can allow them. State gets [AEP-0025](../aep/0025-state.md) (G03, G53, G58). diff --git a/docs/v1alpha3-review-guide.md b/docs/v1alpha3-review-guide.md index 343d84f..1d78e22 100644 --- a/docs/v1alpha3-review-guide.md +++ b/docs/v1alpha3-review-guide.md @@ -28,7 +28,7 @@ cannot be stored as one: the API server drops unknown `metadata` fields (`versio Kubernetes implementation would have to wrap the AWP document in its own resource. A Kubernetes runtime proof of concept then built an operator, a step runner and one real workflow -against the draft. Its findings (G01 to G39 in [runtime-feedback.md](runtime-feedback.md)) went +against the draft. Its findings (G01 to G61 in [runtime-feedback.md](runtime-feedback.md)) went into AEPs, as decision D18 asks. The runtime is not named (D17). ## 2. What to read and what to skip @@ -143,7 +143,7 @@ it. It is a concept: nothing in the schema changes until the project lead decide 2. **Extension model.** Follow AEP-0021 (reverses D3 and D12) or keep `extensions` objects? 3. **Kubernetes text.** Normative Kubernetes mapping in spec 3.10, or Kubernetes-only text marked informative (K, G26, G39)? -4. The remaining questions in [runtime-feedback.md section 8](runtime-feedback.md#8-questions-for-the-project-lead) +4. The remaining questions in [runtime-feedback.md section 10](runtime-feedback.md#10-questions-for-the-project-lead) (next AEPs for state and secret scopes, model parameters, collecting clarifications). ## 6. How it was tested From bbb8aeeaa0793ebe54c26a34677df681b5d59c2f Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Sun, 22 Nov 2026 01:24:33 +0100 Subject: [PATCH 04/14] docs(aep): step isolation, event triggers and state as AEP-0023 to 0025 AEP-0023 defines host syntax, the platform ceiling, enforce or reject, internal destinations denied by default under the security profile unless manifest and ceiling allow them, and model credentials outside steps. AEP-0024 builds event triggers on CloudEvents with filter semantics, deduplication, rate limits and an attested actor. AEP-0025 declares state with classification, retention and sharing. AEP-0021 B4 no longer treats triggers[].source as a value space, and spec v1alpha3 section 12 lists state as untrusted input. Signed-off-by: Simon Lauger --- CHANGELOG.md | 4 + aep/0021-extension-model.md | 6 +- aep/0023-step-isolation.md | 242 +++++++++++++++++++++++++++++++++++ aep/0024-event-triggers.md | 249 ++++++++++++++++++++++++++++++++++++ aep/0025-state.md | 181 ++++++++++++++++++++++++++ spec/README.md | 3 + spec/v1alpha3/README.md | 4 +- 7 files changed, 687 insertions(+), 2 deletions(-) create mode 100644 aep/0023-step-isolation.md create mode 100644 aep/0024-event-triggers.md create mode 100644 aep/0025-state.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 00c4993..9a36817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ API versions (`v1alpha1`, ...) are versioned separately, see [GOVERNANCE.md](GOV ### Changed +- AEP-0021 B4: `triggers[].source` is no domain-prefixed value space; it is the CloudEvents `source` of the event producer (runtime feedback G54). +- Spec `v1alpha3` section 12: content kept between executions (state) is untrusted input like tool results (runtime feedback G58). - README: the minimal manifest is now valid under all profiles (classification, declared MCP server, explicit tools and permissions). - Conformance case `3.2-unsupported-api-version` uses `awp.agenticworkflowprotocol.org/v9`, because `v1alpha3` is now a supported version of the reference checker. - The repository is implementation-neutral (decision D17): implementation-specific alignment documents, mappings and the single implementation page were removed, the AEPs describe prior art without naming products, the extension prefix list starts empty, and the project contact is info@agenticworkflowprotocol.org. Repository links point to `agenticworkflowprotocol/agenticworkflowprotocol.org`. @@ -31,6 +33,8 @@ API versions (`v1alpha1`, ...) are versioned separately, see [GOVERNANCE.md](GOV ### Added - Decision D21 (refines D17): open specifications and vendor-neutral foundation projects may be named as prior art, not as dependencies. Spec `v1alpha3` section 1.2 and the README name the Open Workflow Specification and agent-sandbox as related work; AEP-0022 names the `for` task of the Open Workflow Specification as prior art. +- AEP-0023 (step isolation: network permissions, platform ceilings and model credentials), AEP-0024 (event triggers with CloudEvents) and AEP-0025 (state across executions) as Draft for `v1alpha3`, from runtime feedback G03, G10, G42 to G47, G49 to G51, G53, G54, G56, G58 and G61. +- `docs/runtime-feedback.md`: gaps G41 to G61 (event triggers, the concept review, models), with the AEP each belongs to and the evidence from the runtime. - Decision D20: the Kubernetes resource model draft of pull request #16 becomes `v1alpha3` and starts from `v1alpha2`; the 5-day discussion period is waived for it. `v1alpha3` has step iteration as section 5.6.5, combined with the step output interface: each item run produces its outputs through `$AWP_OUTPUTS` or `complete_step`, command steps get `AWP_FOREACH_INDEX`, an output referenced by `forEach.items` is parsed as a JSON array, and `forEach` is not allowed on input steps (section 14.2 lists the changes from `v1alpha2`). - Conformance suite for `v1alpha2` (`conformance/v1alpha2/`): the `v1alpha1` cases with apiVersion `v1alpha2` plus the step iteration cases; the `v1alpha3` suite has the step iteration cases too. `awp-check.mjs migrate` also converts `v1alpha2` manifests. - Website: `v1alpha3` as a proposed draft next to `v1alpha1` and `v1alpha2`. diff --git a/aep/0021-extension-model.md b/aep/0021-extension-model.md index c3bbae4..0ddd84f 100644 --- a/aep/0021-extension-model.md +++ b/aep/0021-extension-model.md @@ -182,13 +182,17 @@ Implementation-specific: | --- | --- | --- | | `model.provider` | names listed by AWP | `models.example.com/gateway` | | `secrets[].source` | names listed by AWP (resolved by the runtime) | `secrets.example.com/vault-ha` | -| `triggers[].source` (event) | names listed by AWP | `events.example.com/github` | | audit event types | `workflow.*`, `agent.*`, ... | `example.com/cache.hit` (today reverse-domain) | | condition types | `Valid`, `Ready`, `Accepted`, `Succeeded`, `ResolvedRefs`, `PoliciesAttached`, `Bound` | `runtime.example.com/Scheduled` (rule already in spec 3.11) | The same rule applies wherever AWP later opens a value space. A runtime that does not know a value rejects the manifest. +`triggers[].source` of an event trigger is not such a value space: it is matched against the +CloudEvents `source` attribute and names the event producer (spec 5.2, AEP-0004, AEP-0024). Which +adapter or transport delivers the event is runtime configuration, for example in a trigger +object (runtime feedback G52, G54). + ### B5. Policy attachment `Policy` gets `targetRefs`, so that a platform team can attach a policy to workflows without diff --git a/aep/0023-step-isolation.md b/aep/0023-step-isolation.md new file mode 100644 index 0000000..ab828f5 --- /dev/null +++ b/aep/0023-step-isolation.md @@ -0,0 +1,242 @@ +# AEP-0023: Step isolation: network and credentials + +| | | +| --- | --- | +| **AEP** | 0023 | +| **Title** | Step isolation: network permissions, platform ceilings and model credentials | +| **Authors** | @agenticworkflowprotocol | +| **Shepherd** | to be assigned (not an author, [aep-process 5.1](../docs/aep-process.md#51-review-before-acceptance)) | +| **Type** | Specification | +| **Status** | Draft | +| **Reviewer roles needed** | runtime implementer (Kubernetes operator), runtime implementer (non-Kubernetes), security reviewer, platform operator | +| **Reviewers** | none yet | +| **Target API version** | `v1alpha3` | +| **Profiles affected** | `core`, `security` | +| **Created** | 2026-11-22 | +| **Discussion** | issue to be opened | +| **Supersedes** | - | +| **Superseded-by** | - | + +## Summary + +`permissions.network` says what a workflow or agent needs, but not how host names are written, +how the rule relates to limits that the platform sets (network policies, egress proxies, +firewalls), what happens when a runtime cannot enforce it, or which addresses an allowed host may +resolve to. Model credentials are not covered at all. This AEP defines the host syntax, makes the +effective network the intersection of the manifest and a platform ceiling, requires a runtime to +enforce or reject, denies private and internal destinations after resolution by default under the +`security` profile unless both the manifest and the ceiling allow them, defaults `egress` to `deny` +under that profile, and keeps model credentials out of steps. It answers runtime feedback G10, +G47, G49, G50, G51 and G61. + +## Motivation + +- **Two places restrict egress.** A platform restricts network access per namespace or workload + (Kubernetes `NetworkPolicy`, a service mesh, an egress proxy, a firewall). The specification + forms the intersection only between AWP permission objects (spec 7.5.4) and says nothing about + such a ceiling (G47). An author cannot tell whether a reviewed manifest will run, and an + operator cannot tell whether a manifest asks for more than the platform allows. +- **Enforcement is not required.** A runtime that cannot restrict command-step egress by host + name can silently ignore `allowHosts` (G10, G51). A proof-of-concept runtime rejected such + manifests instead, which is the fail-closed reading, but nothing requires it. +- **No syntax.** Subdomain wildcards, ports, IP literals and CIDRs are undefined (G49), so the + same allowlist means different things in different runtimes and cannot be translated into a + proxy or policy configuration. +- **SSRF.** A host on the allowlist can resolve to loopback, private, link-local (cloud metadata) + or CGNAT addresses, also after a redirect or a DNS change between check and connection (DNS + rebinding). The tool proxy of a proof of concept had exactly this hole (G50). +- **Internal services are legitimate.** Agents often need an internal ticket system, a model + server in the cluster or a database. A blanket ban on private addresses would force operators + to switch the protection off entirely. +- **Model credentials.** The specification does not say where provider keys live. A runtime may + hand the key to the agent step, where any command or injected instruction can read and + exfiltrate it (G61). +- **Default `egress: allow`** conflicts with deny-by-default deployments and with the intent of + the `security` profile. + +## Goals and non-goals + +- Goals: one host syntax; a defined relation between manifest and platform ceiling; enforce or + reject; safe defaults under `security`; internal destinations possible when explicitly + allowed; model credentials outside steps. +- Non-goals: a mechanism (proxy, mesh, policy engine); per-port or per-protocol firewall rules; + inbound traffic; secret stores (spec 7.9 stays as it is). + +## Specification + +### Changes to section 7.5.1 (fields) + +| Field | Type | Description | +| ----- | ---- | ----------- | +| `network.egress` | string | `allow` or `deny`: outbound network access of command steps and built-in tools. Default `allow`; under the `security` profile the default is `deny`. | +| `network.allowHosts` | list | Destinations reachable when `egress` is `deny`, in the syntax of section 7.5.5. | + +### New section 7.5.5 (network destinations) + +An entry of `allowHosts` is one of: + +| Form | Example | Matches | +| ---- | ------- | ------- | +| Host name | `api.example.com` | exactly this name (case-insensitive, without trailing dot) | +| Subdomain wildcard | `*.example.com` | any name with at least one label before `example.com`, not `example.com` itself | +| Address | `10.20.0.15`, `2001:db8::1` | exactly this address | +| CIDR | `10.20.0.0/16` | any address in the range | + +Each form MAY end with `:`; without a port, every port matches. A `*` anywhere other than as +the first label is invalid, and so is a bare `*`. Validators MUST reject invalid entries. + +Host name entries are matched against the name the step requested, before resolution. Address and +CIDR entries are matched against the resolved address. + +### New section 7.5.6 (enforcement and platform ceilings) + +- **Effective network.** A platform MAY set a ceiling on the network access of executions + (for example per namespace, tenant or runtime installation). The effective network access of a + step is the intersection of every applicable `permissions.network` (spec 7.5.4) and the + ceiling. +- **Enforce or reject.** A runtime MUST enforce the effective network access for every step type + it runs, with a mechanism of its choice. A runtime MAY restrict further. If a runtime cannot + enforce a rule for a step type, or the ceiling does not allow a destination that the manifest + requires, the runtime MUST reject the manifest or the execution before any step runs, with a + reason that names the rule and the step type. It MUST NOT run the step with weaker + restrictions. +- **Internal destinations (security profile).** After resolution, the runtime MUST deny + connections to loopback (`127.0.0.0/8`, `::1`), private (`10.0.0.0/8`, `172.16.0.0/12`, + `192.168.0.0/16`, `fc00::/7`), link-local (`169.254.0.0/16`, `fe80::/10`), CGNAT + (`100.64.0.0/10`) and unspecified addresses by default. Such a destination is allowed only if + **both** hold: the manifest allows it explicitly (an address or CIDR entry that contains the + resolved address, or a host name entry for the name that resolved to it), and the platform + ceiling allows the resolved address. This is no blanket ban: agents may use internal services + when author and operator both say so. The check MUST apply to the address actually connected + to, including after redirects, so that a DNS change between check and connection cannot reach + an address that the ceiling does not allow. +- **Conformance statement.** A runtime MUST state per step type how it enforces network access and + which ceiling sources it reads (spec 11). + +Informative: a per-workload egress proxy with an allowlist derived from `allowHosts`, plus a +network policy that lets the workload reach only that proxy, is one conforming enforcement for +command steps. A built-in tool can enforce in-process with a connection-time address check. + +### Changes to section 7.9 (secrets): model credentials + +- Credentials for model providers are runtime configuration, not manifest content. +- Under the `security` profile, model credentials MUST NOT be visible to steps: not in the + environment, the filesystem or the arguments of a step. The runtime calls the provider itself + or through a proxy that authenticates the step with a credential that is short-lived and bound + to one execution or attempt. +- Outside the `security` profile, a runtime that exposes model credentials to steps MUST say so + in its conformance statement. + +### Change to the profile table (spec 11) + +`security`: add "network enforcement or rejection (7.5.6), internal destinations (7.5.6), model +credentials outside steps (7.9)". + +## Examples + +```yaml +apiVersion: awp.agenticworkflowprotocol.org/v1alpha3 +kind: Workflow +metadata: + name: ticket-triage +spec: + version: 0.1.0 + owner: + team: support + classification: internal + permissions: + network: + egress: deny + allowHosts: + - api.example.com + - "*.cdn.example.com:443" + - 10.20.0.0/16 # internal ticket system, explicitly allowed + agents: + - id: triage + model: + provider: example-provider + name: example-model + workflow: + - id: run + agent: triage + task: Triage new tickets. +``` + +Under the `security` profile, a connection to `10.20.4.5` is allowed only if the platform +ceiling also allows that address. If `api.example.com` resolves to `10.1.2.3`, the connection is +allowed only if the ceiling allows `10.1.2.3`; with a ceiling that allows no internal addresses it +is denied. + +## Schema changes + +- `allowHosts` items: a pattern for the four forms with optional port. +- Semantic rule `permissions.network.host-invalid` for wildcards outside the first label, bare + `*` and invalid CIDRs. + +## Conformance impact + +- `core`: host syntax, enforce-or-reject, conformance statement. +- `security`: default `egress: deny`, internal destinations, model credentials. +- Valid: `7.5.5-allow-hosts-forms.yaml`. Invalid: `7.5.5-allow-hosts-bare-wildcard.yaml`, + `7.5.5-allow-hosts-inner-wildcard.yaml`, `7.5.5-allow-hosts-invalid-cidr.yaml`. +- Runtime tests (once a runtime suite exists): a host that resolves to a private address; a + redirect to `169.254.169.254`; a DNS answer that changes between two lookups; a ceiling that + forbids a required host (rejected before start). + +## Compatibility and migration + +- Manifests with host names only stay valid. Entries that were tolerated before and are invalid + now (bare `*`) become invalid. +- Under `security`, manifests without `network` change from "egress allowed" to "egress denied"; + authors add `egress: allow` or `allowHosts`. +- Runtimes that ignored `allowHosts` for command steps must enforce or reject. + +## Security considerations + +The AEP closes SSRF through allowed hosts, prevents silent weakening of reviewed network rules and +keeps provider keys out of reach of prompt injection. Allowing internal destinations requires +agreement of author (manifest) and operator (ceiling), so neither alone can open the internal +network. + +## Privacy considerations + +None beyond spec 7.2. Host names in audit events may reveal which services a workflow uses. + +## Compliance note + +AWP provides machine-readable governance primitives that can help organizations implement and +enforce their own compliance requirements. This proposal makes no compliance promise. + +## Alternatives + +- **Leave network to the platform.** Rejected: the reviewed manifest would say nothing about what + a workflow reaches, and runtimes could not reject what they cannot run. +- **Blanket ban on private addresses.** Rejected: agents need internal services; operators would + disable the protection altogether. +- **Allow internal destinations by the manifest alone.** Rejected: a public name can point + anywhere after a DNS change, which is the attack; the platform ceiling decides which internal + addresses exist for a workload. +- **Name a mechanism (proxy, network policy).** Rejected: not portable; kept as informative text. + +## Implementation status + +A proof-of-concept Kubernetes runtime checks the resolved address at connection time in its tool +proxy, rejects workflow-level egress rules it cannot enforce for command steps, and keeps provider +keys out of step pods (short-lived credential per attempt). It has no explicit DNS rebinding test +and no measurement of proxy latency or cost. + +## Open questions + +1. Should the ceiling be visible to authors, for example in the status of a binding or workflow + (`Accepted` with reason `NetworkCeiling`)? +2. Do MCP servers over `streamable-http` fall under the same rules as built-in tools? + +## Decision + +Not decided. Number and scope assigned by the maintainer on 2026-11-22. + +## References + +- Runtime feedback G10, G47, G49, G50, G51, G61 ([runtime-feedback.md](../docs/runtime-feedback.md)). +- Spec `v1alpha3` sections 7.5, 7.9, 11. +- Kubernetes `NetworkPolicy`; RFC 1918, RFC 6598 (CGNAT), RFC 4193 (unique local IPv6). diff --git a/aep/0024-event-triggers.md b/aep/0024-event-triggers.md new file mode 100644 index 0000000..c28fe87 --- /dev/null +++ b/aep/0024-event-triggers.md @@ -0,0 +1,249 @@ +# AEP-0024: Event triggers with CloudEvents + +| | | +| --- | --- | +| **AEP** | 0024 | +| **Title** | Event triggers with CloudEvents: filters, duplicates, actors and conversation context | +| **Authors** | @agenticworkflowprotocol | +| **Shepherd** | to be assigned (not an author, [aep-process 5.1](../docs/aep-process.md#51-review-before-acceptance)) | +| **Type** | Specification | +| **Status** | Draft | +| **Reviewer roles needed** | runtime implementer (Kubernetes operator), runtime implementer (non-Kubernetes), security reviewer, privacy reviewer | +| **Reviewers** | none yet | +| **Target API version** | `v1alpha3` | +| **Profiles affected** | `core`, `governance`, `audit` | +| **Created** | 2026-11-22 | +| **Discussion** | issue to be opened | +| **Supersedes** | - | +| **Superseded-by** | - | + +## Summary + +Spec 5.2 lets an `event` trigger start an execution, but leaves the event format, filter +semantics, duplicates, concurrency, the actor and conversation context open. This AEP uses +CloudEvents 1.0 as the event model, defines `filter` as equality on CloudEvents attributes and +data paths, requires deduplication by `source` and `id`, adds `concurrencyPolicy` and a rate limit +to event triggers, records the authenticated source and an attested person as the actor so that +approval rules bind that person, and defines where conversation context and reply data live. It +builds on AEP-0004 (`${{ event.* }}`, `dataSchema`, decision D7) and AEP-0019 (`WorkflowRun`), and +answers runtime feedback G42 to G46, G54 and G56. Runtime trigger objects (G52) belong to AEP-0021. + +## Motivation + +A proof-of-concept runtime starts workflows from chat mentions: a bridge publishes each message as +a CloudEvent to a message broker, an event router with one filter object per workflow creates +runs, and a step answers in the originating thread. Routing involves no model, so a message cannot +redirect it by prompt. It found: + +- **Filters** are a map of strings, but which fields they match, how they compare and how entries + combine is undefined (G42). Each router has its own filter language. +- **Duplicates** are real: message brokers and webhooks redeliver, and the runtime saw a second + run for the same event, which it rejected as duplicate. `concurrencyPolicy` exists only for + `schedule` (G43). +- **Actor.** Spec 5.2 gives every event start the actor type `system`. The authenticated party is + the bridge, not the person who wrote the message. Approval rules that refer to the initiator + (`initiatorCannotApprove`, `actorCannotApproveOwnAction`, spec 7.6) then do not bind that + person, who can trigger a run by message and approve its request (G44). +- **Reply path.** A run started by a message cannot refer to where the message came from (G45). +- **Conversation context.** A reply in a thread only sees the triggering message (G46). The proof + of concept lets the bridge attach earlier messages and participants. +- **`source`** means the event producer in spec 5.2 and AEP-0004 (`git.example.com`) and an + adapter name in AEP-0021 B4 (G54). +- **Delivery.** A router silently weakened delivery from "at least once" to "at most once" (an + MQTT subscription with QoS 0) (G56). + +## Goals and non-goals + +- Goals: portable event triggers on top of CloudEvents; no execution from a forged or duplicate + event; approvals that bind the person behind an event; conversation context as data, not as + instructions. +- Non-goals: transports (MQTT, webhooks, queues); router configuration (implementation-specific + trigger objects, AEP-0021); delivery of replies (steps do that); standard interaction event + types (a later AEP). + +## Specification + +### Changes to section 5.2: event model + +- An event is a CloudEvent 1.0. Runtimes that receive events in another format MUST map them to + the CloudEvents attributes before matching. +- `source` of an `event` trigger is matched against the CloudEvents `source` attribute + (URI-reference). It names the producer, not the adapter or transport; choosing an adapter + belongs to runtime configuration. `eventType` is matched against `type`. +- `event.id`, `event.source`, `event.type`, `event.subject`, `event.time` and `event.data` in + expressions (AEP-0004) are the CloudEvents attributes of that name. + +### Filter semantics + +- Keys of `filter` are CloudEvents attribute names (`subject`, extension attributes) or + `data.` with dot-separated object keys. Values are strings and match by equality with the + string form of the attribute or value. All entries MUST match. A missing attribute or path does + not match. +- Runtime-specific conditions (expression languages, rate rules) MAY be configured in an + implementation-specific trigger object (AEP-0021). They MAY only narrow the manifest trigger: an + event that does not match the manifest trigger MUST NOT start an execution, whatever the + runtime configuration says. + +### Duplicates, concurrency and rate + +- The runtime MUST NOT start a second execution for an event with the same `source` and `id` + within a deduplication window. It MUST state the window in its conformance statement; the + window MUST be at least 24 hours. A rejected duplicate MUST be recorded as `trigger.skipped` with + reason `duplicate`. +- An `event` trigger MAY have `concurrencyPolicy` with the values and semantics of a `schedule` + trigger (default `allow` for events), considering executions started by the same trigger entry. +- An `event` trigger MAY have `rateLimit` with `maxExecutions` (integer) per `period` (duration). + Events over the limit MUST NOT start executions and MUST be recorded as `trigger.skipped` with + reason `rateLimited`. + +| Field | Type | Req. | Description | +| ----- | ---- | ---- | ----------- | +| `concurrencyPolicy` | string | no | `allow` (default), `forbid` or `replace`, as for `schedule`. | +| `rateLimit` | object | no | `maxExecutions` (integer, REQUIRED) and `period` (duration, REQUIRED). | + +### Actor (changes to sections 5.2, 7.6 and 10.3) + +Replaces the sentence "An execution started by `schedule` or `event` has the actor type `system`" +for `event`: + +- An execution started by an `event` trigger has the actor type `system` with `id` set to the + authenticated identity of the event source (the transport identity the runtime verified). +- If the event carries a person attested by that source, the runtime MAY record it as + `attestedActor` (`type: human`, `id`) in `workflow.started`, but only if the runtime's + configuration marks the source as trusted to attest people. Otherwise it MUST NOT record one. +- Approval rules that refer to the initiator (`initiatorCannotApprove`, + `actorCannotApproveOwnAction`) MUST treat the attested actor as the initiator. +- A policy MAY require an attested actor for an event trigger (condition `trigger.attested`); + without one, the execution MUST NOT start. + +Informative: a bridge that is the only identity allowed to publish on a broker topic, and that +reads the author from the chat system with its own credentials, attests through transport +authorisation, not end to end. A signature over the event would be stronger. + +### Conversation context and reply data + +- Conversation context (earlier messages of a thread, participants) is part of `event.data`. It + is untrusted input (AEP-0004), has the classification of `event.data`, and participants and + message texts are personal data in the sense of spec 7.2. +- Correlation data for a reply (thread, message, channel) SHOULD be carried in `event.subject` or + in `event.data`; delivery of a reply is the job of a step. +- Informative: a standard shape for thread context and reply targets is left to a later AEP with + frontend-neutral interaction event types. + +### Conformance statement (spec 11) + +A runtime MUST state, per supported event source, the delivery guarantee from the source to the +start of an execution (at most once, at least once) and its deduplication window. + +## Examples + +```yaml +apiVersion: awp.agenticworkflowprotocol.org/v1alpha3 +kind: Workflow +metadata: + name: chat-assistant +spec: + version: 0.1.0 + owner: + team: support + classification: internal + triggers: + - type: event + source: chat.example.com + eventType: com.example.chat.message.posted + filter: + data.mentions: assistant + concurrencyPolicy: allow + rateLimit: + maxExecutions: 20 + period: 1h + dataSchema: + type: object + required: [message, thread] + properties: + message: { type: string, maxLength: 4000 } + thread: { type: string, maxLength: 64 } + agents: + - id: assistant + model: + provider: example-provider + name: example-model + workflow: + - id: answer + agent: assistant + task: "Answer this message: ${{ event.data.message }}" +``` + +## Schema changes + +- Event trigger: `concurrencyPolicy`, `rateLimit {maxExecutions, period}`. +- `filter` keys: pattern for attribute names and `data.`. +- Policy condition `trigger.attested` (boolean). +- `workflow.started`: optional `attestedActor`. + +## Conformance impact + +- `core`: filter semantics, deduplication, conformance statement. +- `governance`: attested actor in approval rules, `trigger.attested`. +- `audit`: `trigger.skipped` reasons `duplicate`, `rateLimited`; `attestedActor`. +- Valid: `5.2-event-filter-data-path.yaml`, `5.2-event-rate-limit.yaml`. Invalid: + `5.2-event-filter-invalid-key.yaml`, `5.2-event-rate-limit-missing-period.yaml`. +- Runtime tests: the same event twice; an event that matches the runtime filter but not the + manifest filter; an approval requested in a run started by the approver's own message. + +## Compatibility and migration + +Additive except for `filter`: runtimes that interpreted filter keys differently must follow the +new semantics. AEP-0021 B4 loses `triggers[].source` as a domain-prefixed value space. + +## Security considerations + +- Deduplication and rate limits stop replay and flooding. +- Narrow-only runtime filters keep the reviewed trigger as the upper bound. +- Approval rules bind the person behind an event; without this, a message could start a run whose + request the same person approves. +- Conversation context is untrusted input and can carry prompt injection from other participants. + +## Privacy considerations + +Thread context contains messages and identities of people who did not start the run. Runtimes +SHOULD cap its size, MUST apply the data policy of `event.data` to it, and SHOULD NOT include it +in audit events beyond the metadata level. + +## Compliance note + +AWP provides machine-readable governance primitives that can help organizations implement and +enforce their own compliance requirements. This proposal makes no compliance promise. + +## Alternatives + +- **Map events to inputs.** Rejected by D7; AEP-0004 keeps event data recognisable as untrusted. +- **A filter expression language in the manifest.** Rejected: not portable across routers; + equality is the portable floor, richer rules live in runtime objects. +- **Always actor `system`.** Rejected: leaves the approval hole of G44. +- **Always trust a person named in the event.** Rejected: any publisher could name anyone. + +## Implementation status + +A proof-of-concept Kubernetes runtime receives chat messages as CloudEvents through a broker and an +event router, deduplicates by `source` and `id`, and answers in the thread from a step. It plans +to create event runs itself from a trigger object generated from `spec.triggers`. The router it +uses subscribes to MQTT with QoS 0. The thread limits of its bridge (30 entries, 12,000 +characters) are set, not measured. + +## Open questions + +1. Is 24 hours the right minimum deduplication window? +2. Should `attestedActor` also be allowed for `manual` starts through a trusted front end? +3. How does a client run carry an event for testing or replay (AEP-0019 open question 1, runtime + feedback G48 and G57)? Proposed as an amendment of AEP-0019. + +## Decision + +Not decided. Number and scope assigned by the maintainer on 2026-11-22. + +## References + +- Runtime feedback G42 to G46, G54, G56 ([runtime-feedback.md](../docs/runtime-feedback.md)). +- AEP-0004, AEP-0019, AEP-0021; decision D7. +- CloudEvents 1.0 specification. diff --git a/aep/0025-state.md b/aep/0025-state.md new file mode 100644 index 0000000..7e19279 --- /dev/null +++ b/aep/0025-state.md @@ -0,0 +1,181 @@ +# AEP-0025: State across executions + +| | | +| --- | --- | +| **AEP** | 0025 | +| **Title** | State across executions: declared, classified, shared and untrusted | +| **Authors** | @agenticworkflowprotocol | +| **Shepherd** | to be assigned (not an author, [aep-process 5.1](../docs/aep-process.md#51-review-before-acceptance)) | +| **Type** | Specification | +| **Status** | Draft | +| **Reviewer roles needed** | runtime implementer (Kubernetes operator), runtime implementer (non-Kubernetes), security reviewer, privacy reviewer | +| **Reviewers** | none yet | +| **Target API version** | `v1alpha3` | +| **Profiles affected** | `core`, `governance`, `audit` | +| **Created** | 2026-11-22 | +| **Discussion** | issue to be opened | +| **Supersedes** | - | +| **Superseded-by** | - | + +## Summary + +Workflows keep data between executions ("already reported", user preferences), but AWP has no +state: a runtime provides it invisibly (a volume of its binding), without data class, retention +or access rules. This AEP declares state in the manifest as named stores with classification, +retention and an access mode per workflow, lets several workflows of one owner share a store with +rules for concurrent writers, and makes state untrusted input for models. It answers runtime +feedback G03, G53 and G58. + +## Motivation + +- **Invisible state (G03).** A proof-of-concept workflow remembers which events it already + reported in a file on a volume of its runtime binding. Reviewers cannot see that the workflow + stores data, which class it has or how long it is kept. +- **Shared state (G53).** A daily workflow writes what it found; a chat workflow of the same owner + reads it and writes preferences that the daily workflow reads. Two workflows need the same store + with different rights. Derived from the proof of concept, not observed as a conflict: a + preference written during a daily run takes effect a day later, and two chat runs can write the + same file at once. +- **Memory poisoning (G58).** State written by one execution is read as data by the next. A chat + message or a web page that ends up in state becomes a persistent instruction, seen in the chat + workflow of the proof of concept. Spec 12 lists tool results and remote agent messages as + untrusted input, not state. + +## Goals and non-goals + +- Goals: state visible in review; classification and retention; shared stores with access modes; + defined behaviour with concurrent writers; state as untrusted input. +- Non-goals: a storage technology; queries or schemas inside the store; state inside one + execution (step outputs, AEP-0018). + +## Specification + +### New section 5.9: state + +`spec.state` declares stores that survive executions. + +| Field | Type | Req. | Description | +| ----- | ---- | ---- | ----------- | +| `name` | string | yes | Store name, unique per owner (`spec.owner`) and namespace. | +| `access` | string | no | `read` or `readWrite` (default). | +| `classification` | string | no | Data class of the content. Default: `spec.classification`. | +| `retention` | duration | no | How long content is kept after its last write. Default: runtime-defined, stated in the conformance statement. | +| `maxSize` | string | no | Upper bound (for example `64Mi`); the runtime MUST reject writes beyond it. | + +- A store is provided to command steps as a directory (`$AWP_STATE_DIR/`) and to agent steps + only through tools the manifest grants. The runtime MUST NOT expose stores that are not + declared. +- **Sharing.** Workflows with the same `spec.owner` in the same namespace that declare a store of + the same `name` share it. If their `classification` values differ, the strictest applies to + every reader. A runtime MUST reject a declaration that would give a workflow of another owner + access. +- **Concurrent writers.** The runtime MUST make each write of a file or key atomic. It MUST state + in its conformance statement whether concurrent executions writing the same store are + serialised or last-writer-wins. With `readWrite`, a step MUST NOT see a partially written value. +- **Absent store.** A store that does not exist yet is empty; the first `readWrite` execution + creates it. +- **Audit.** `workflow.started` lists the stores and their access modes. Writes SHOULD be + recorded at metadata level (store, key or path, size). + +### Change to section 12 (security considerations) + +Extend "Prompt injection": tool results, remote agent messages **and content read from state** are +untrusted input. Content written to state by an earlier execution MUST be treated like a tool +result of unknown origin; runtimes SHOULD mark its origin when passing it to a model (see runtime +feedback G11). + +### Change to section 7.2 (data classification) + +Reading a store counts as an operation on data of the store's `classification`. + +## Examples + +```yaml +apiVersion: awp.agenticworkflowprotocol.org/v1alpha3 +kind: Workflow +metadata: + name: daily-digest +spec: + version: 0.1.0 + owner: + team: example-team + classification: internal + state: + - name: seen-items + retention: 180d + maxSize: 64Mi + - name: preferences + access: read + workflow: + - id: diff + type: command + image: registry.example.com/tools:1.0.0 + command: python3 /opt/diff.py +``` + +A second workflow `chat-assistant` of the same owner declares `preferences` with `readWrite` and +`seen-items` with `read`. + +## Schema changes + +- `spec.state` array with the fields above. +- Semantic rule `state.duplicate-name` within one manifest. + +## Conformance impact + +- `core`: declaration, exposure only of declared stores, atomic writes, conformance statement. +- `governance`: classification of shared stores. +- `audit`: stores in `workflow.started`, write records. +- Valid: `5.9-state-shared.yaml`. Invalid: `5.9-state-duplicate-name.yaml`, + `5.9-state-invalid-access.yaml`. + +## Compatibility and migration + +Additive. Runtimes that provide state through their own binding declare it in the manifest instead; +until then, such state is outside the reviewed manifest. + +## Security considerations + +Declared state makes persistence reviewable and limits sharing to one owner. Treating state as +untrusted closes the path from one injected message to a permanent instruction. Atomic writes +prevent torn values that a later step could misread. + +## Privacy considerations + +State may hold personal data (preferences, conversation summaries). `retention` and +`classification` let operators apply deletion and access rules; runtimes SHOULD support deleting a +store on request. + +## Compliance note + +AWP provides machine-readable governance primitives that can help organizations implement and +enforce their own compliance requirements. This proposal makes no compliance promise. + +## Alternatives + +- **Keep state in the runtime binding.** Rejected: invisible to review (G03). +- **Share across owners by reference.** Rejected for now: needs an access model between owners. +- **A key-value API instead of directories.** Left open: directories match the step interface of + AEP-0018; a key-value form can be added. + +## Implementation status + +A proof-of-concept Kubernetes runtime provides one volume per workflow through its binding and +mounts it at `/awp/state`. Sharing between workflows and the conflict scenario are derived, not +implemented. + +## Open questions + +1. Should stores be their own kind (`State`) instead of a manifest field, so that ownership and + retention live in one place? +2. Is one owner per namespace the right sharing boundary? +3. Should agent steps get a built-in state tool, or only command steps a directory? + +## Decision + +Not decided. Number and scope assigned by the maintainer on 2026-11-22. + +## References + +- Runtime feedback G03, G11, G53, G58 ([runtime-feedback.md](../docs/runtime-feedback.md)). +- AEP-0018 (step outputs); spec `v1alpha3` sections 7.2, 12. diff --git a/spec/README.md b/spec/README.md index 09d7dbe..3f4d1f6 100644 --- a/spec/README.md +++ b/spec/README.md @@ -44,6 +44,9 @@ and a Final Comment Period, and may still be moved to a later version or rejecte | [0020](../aep/0020-execution-pinning.md) | Pinning an execution to its manifests | Draft | proposed for `v1alpha3` | | [0021](../aep/0021-extension-model.md) | Extension model aligned with the Kubernetes Gateway API (concept) | Draft | proposed for `v1alpha3` | | [0022](../aep/0022-step-iteration.md) | Step iteration (`forEach`) | Accepted (lead decision D19) | in the `v1alpha2` draft | +| [0023](../aep/0023-step-isolation.md) | Step isolation: network permissions, platform ceilings and model credentials | Draft | proposed for `v1alpha3` | +| [0024](../aep/0024-event-triggers.md) | Event triggers with CloudEvents | Draft | proposed for `v1alpha3` | +| [0025](../aep/0025-state.md) | State across executions | Draft | proposed for `v1alpha3` | The specification text is licensed under [CC BY 4.0](../LICENSE-SPEC); examples, schemas and code are licensed under [Apache-2.0](../LICENSE). diff --git a/spec/v1alpha3/README.md b/spec/v1alpha3/README.md index ae705c8..c48ee9e 100644 --- a/spec/v1alpha3/README.md +++ b/spec/v1alpha3/README.md @@ -2130,7 +2130,9 @@ AWP anticipates a common command-line vocabulary (`awp validate`, `awp lint`, `a - **Fail closed.** Unknown fields, unsupported profiles, undeterminable regions or resources and unverifiable digests lead to rejection or denial, never to silent acceptance. -- **Prompt injection.** Tool results and remote agent messages are untrusted input. Governance in +- **Prompt injection.** Tool results, remote agent messages and content that a runtime keeps + between executions and passes to a later model invocation (state) are untrusted input: a message + stored by one execution must not become an instruction for the next. Governance in AWP is enforced by the runtime **outside** the model: an agent cannot change permissions, policies, budgets or approvals by producing text. Runtimes MUST NOT allow model output to modify the effective manifest of a running execution. From 1b50af1c181c9d89c079d549ae032320c2e0e079 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Sun, 22 Nov 2026 19:02:53 +0100 Subject: [PATCH 05/14] docs(aep): prior art for AEP-0023 and AEP-0024 AEP-0024 names the listen task of the Open Workflow Specification, AEP-0023 names agent-sandbox, both under decision D21 (pull request Signed-off-by: Simon Lauger #20). --- aep/0023-step-isolation.md | 8 ++++++++ aep/0024-event-triggers.md | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/aep/0023-step-isolation.md b/aep/0023-step-isolation.md index ab828f5..8f5047d 100644 --- a/aep/0023-step-isolation.md +++ b/aep/0023-step-isolation.md @@ -218,6 +218,13 @@ enforce their own compliance requirements. This proposal makes no compliance pro addresses exist for a workload. - **Name a mechanism (proxy, network policy).** Rejected: not portable; kept as informative text. +Prior art (named under decision D21): [agent-sandbox](https://agent-sandbox.sigs.k8s.io/) +(Kubernetes SIG Apps) provides isolated, stateful execution environments for agents on +Kubernetes (`Sandbox`, with `SandboxTemplate`, `SandboxClaim` and `SandboxWarmPool`), with the +isolation backend chosen by `RuntimeClass` (for example gVisor or Kata Containers). It is one +platform-side way to run steps in a sandbox and keep warm pools; this AEP does not require it and +states only what the effective network and credential isolation must be. + ## Implementation status A proof-of-concept Kubernetes runtime checks the resolved address at connection time in its tool @@ -240,3 +247,4 @@ Not decided. Number and scope assigned by the maintainer on 2026-11-22. - Runtime feedback G10, G47, G49, G50, G51, G61 ([runtime-feedback.md](../docs/runtime-feedback.md)). - Spec `v1alpha3` sections 7.5, 7.9, 11. - Kubernetes `NetworkPolicy`; RFC 1918, RFC 6598 (CGNAT), RFC 4193 (unique local IPv6). +- agent-sandbox, Kubernetes SIG Apps. diff --git a/aep/0024-event-triggers.md b/aep/0024-event-triggers.md index c28fe87..3582bff 100644 --- a/aep/0024-event-triggers.md +++ b/aep/0024-event-triggers.md @@ -223,6 +223,14 @@ enforce their own compliance requirements. This proposal makes no compliance pro - **Always actor `system`.** Rejected: leaves the approval hole of G44. - **Always trust a person named in the event.** Rejected: any publisher could name anyone. +Prior art (named under decision D21): the `listen` task of the +[Open Workflow Specification](https://github.com/serverlessworkflow/specification) consumes +CloudEvents and filters them with `with` on attributes and `data`, where values may be regular +expressions or runtime expressions, and correlates events with `correlate`. This AEP keeps the +CloudEvents model and attribute names of that design, but restricts the manifest filter to +equality so that every router can evaluate it; richer conditions stay in runtime objects that may +only narrow. + ## Implementation status A proof-of-concept Kubernetes runtime receives chat messages as CloudEvents through a broker and an @@ -247,3 +255,4 @@ Not decided. Number and scope assigned by the maintainer on 2026-11-22. - Runtime feedback G42 to G46, G54, G56 ([runtime-feedback.md](../docs/runtime-feedback.md)). - AEP-0004, AEP-0019, AEP-0021; decision D7. - CloudEvents 1.0 specification. +- Open Workflow Specification, `listen` and `emit` tasks. From fa70eec772a77d0525b8593e2bb81c6039fbac63 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Sun, 22 Nov 2026 19:03:41 +0100 Subject: [PATCH 06/14] docs: link the Open Workflow Specification under its new organisation The repository moved from serverlessworkflow to open-workflow-specification. Signed-off-by: Simon Lauger --- aep/0024-event-triggers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aep/0024-event-triggers.md b/aep/0024-event-triggers.md index 3582bff..a697775 100644 --- a/aep/0024-event-triggers.md +++ b/aep/0024-event-triggers.md @@ -224,7 +224,7 @@ enforce their own compliance requirements. This proposal makes no compliance pro - **Always trust a person named in the event.** Rejected: any publisher could name anyone. Prior art (named under decision D21): the `listen` task of the -[Open Workflow Specification](https://github.com/serverlessworkflow/specification) consumes +[Open Workflow Specification](https://github.com/open-workflow-specification/specification) consumes CloudEvents and filters them with `with` on attributes and `data`, where values may be regular expressions or runtime expressions, and correlates events with `correlate`. This AEP keeps the CloudEvents model and attribute names of that design, but restricts the manifest filter to From 307eba611544141f41f517bb9299c0f2501b1107 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Sun, 22 Nov 2026 19:37:52 +0100 Subject: [PATCH 07/14] docs: mark G23 as resolved by step iteration (AEP-0022) Signed-off-by: Simon Lauger --- docs/runtime-feedback.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/runtime-feedback.md b/docs/runtime-feedback.md index 3d8f37a..04fd850 100644 --- a/docs/runtime-feedback.md +++ b/docs/runtime-feedback.md @@ -34,10 +34,11 @@ portable runtimes, **should** needs a rule, **minor** is editorial or informativ | Status | Entries | | --- | --- | +| Accepted and applied to `v1alpha2` and `v1alpha3` | G23 ([AEP-0022](../aep/0022-step-iteration.md), decision D19) | | AEP drafted and applied to the `v1alpha3` draft (Draft, not accepted) | G01, G07, G08, G40; partly G14, G15 | | AEP drafted, not applied | G10, G47, G49, G50, G51, G61 (AEP-0023); G42 to G46, G54, G56 (AEP-0024); G03, G53, G58 (AEP-0025) | | Covered by an existing AEP that is not applied yet | G02, G04, G06, G22; G41 (AEP-0004); G48, G57 (AEP-0019 open question 1); G52 (AEP-0021); G55 (AEP-0012); G59, G60 (AEP-0008) | -| Open, needs a decision whether and how | G05, G09, G11, G12, G13, G16 to G21, G23 to G39, K | +| Open, needs a decision whether and how | G05, G09, G11, G12, G13, G16 to G21, G24 to G39, K | ## 2. Step interface @@ -66,7 +67,7 @@ portable runtimes, **should** needs a rule, **minor** is editorial or informativ | G20 | should | Expressions have no date or time; a step has to write the fetch date into an output. | `execution.startedAt` as a reference. | open | | G21 | should | Input values cannot be set per environment or deployment; scheduled executions use defaults. | Inputs per environment (7.10) or inputs supplied by the runtime binding for schedule triggers. | open | | G22 | should | Array inputs have no item schema. | `items` and `schema` for array and object inputs. | [AEP-0014](../aep/0014-input-examples-and-schemas.md), not applied | -| G23 | should | No fan-out: an agent step cannot run once per source. | `matrix` or `forEach` over an array. | open | +| G23 | should | No fan-out: an agent step cannot run once per source. | `matrix` or `forEach` over an array. | resolved: `forEach`, [AEP-0022](../aep/0022-step-iteration.md) (accepted, D19), spec `v1alpha3` 5.6.5 | | G24 | should | No limit on output tokens or turns per agent step; large extractions hit hard-coded limits. | `budget.resources.maxOutputTokens` and `maxTurns`. | open | | G25 | minor | The model cannot see which step it serves; a gateway can only guess. | The runtime passes the step id as request metadata (informative). | open | @@ -196,7 +197,7 @@ the question only because runtime-created runs record the trigger in status. well, so that a runtime can test them? 4. K, G26 and G39: a normative Kubernetes mapping in spec 3.10, or an informative page on the website? 5. G09: should this repository publish the validator as a container image for admission webhooks? -6. G13 (`finally`), G23 (fan-out) and G24 with G34 (token and turn limits, model parameters): +6. G13 (`finally`) and G24 with G34 (token and turn limits, model parameters): `v1alpha3` or later? The real run above makes G24/G34 the most pressing of them. 7. G27 to G38 are mostly clarifications. Collect them in one AEP (like AEP-0013) or extend AEP-0013? From 0feac7a4043cbd38cc018d78fc2f34941a16651a Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Mon, 23 Nov 2026 16:18:18 +0100 Subject: [PATCH 08/14] docs: runtime feedback G62 to G87 from interactive sessions Section 10 of the runtime feedback lists what a platform with interactive coding agent sessions and an engine for agent steps had to build itself, with evidence from a test installation, and proposes which platform objects become AWP kinds. AEP-0023 gets the cases that share its reason: credentials of tool servers and the approval authority stay outside the execution environment, agents can require a minimum isolation class, and one rule for ceilings (reject, budgets cap). AEP-0024 and AEP-0025 get evidence from sessions. Signed-off-by: Simon Lauger --- CHANGELOG.md | 4 + aep/0023-step-isolation.md | 201 ++++++++++++++++++++++++++++++++++--- aep/0024-event-triggers.md | 12 +++ aep/0025-state.md | 12 +++ docs/runtime-feedback.md | 90 +++++++++++++++-- 5 files changed, 299 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a36817..60b058e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ API versions (`v1alpha1`, ...) are versioned separately, see [GOVERNANCE.md](GOV ### Changed +- Runtime feedback: section 10 with G62 to G87 from interactive sessions and a coding agent engine, a proposal which platform objects become AWP kinds (extends K), and evidence for G50 and G60. +- AEP-0023 (Draft): credentials of tool servers outside steps (G69), approval authority outside the execution environment (G64), a minimum isolation class on agents (G67), and one rule for platform ceilings: permissions, models, tool servers, autonomy and isolation reject, budgets cap (G68). Answers its open question 2. +- New AEP drafts: AEP-0026 interactive execution (kind `AgentSession`, autonomy levels with an author ceiling, `confirm` per action, G62, G63, G73, G82) and AEP-0027 agent engine (`agents[].engine`, workspace configuration off by default, G65, G66, G81, G83). Numbers to be confirmed. +- AEP-0024 and AEP-0025 (Draft): evidence from interactive sessions (runtime events, event-started sessions, workspaces across pause and resume, shared workspaces). - AEP-0021 B4: `triggers[].source` is no domain-prefixed value space; it is the CloudEvents `source` of the event producer (runtime feedback G54). - Spec `v1alpha3` section 12: content kept between executions (state) is untrusted input like tool results (runtime feedback G58). - README: the minimal manifest is now valid under all profiles (classification, declared MCP server, explicit tools and permissions). diff --git a/aep/0023-step-isolation.md b/aep/0023-step-isolation.md index 8f5047d..7fdf14d 100644 --- a/aep/0023-step-isolation.md +++ b/aep/0023-step-isolation.md @@ -1,9 +1,9 @@ -# AEP-0023: Step isolation: network and credentials +# AEP-0023: Step isolation: network, credentials and approvals | | | | --- | --- | | **AEP** | 0023 | -| **Title** | Step isolation: network permissions, platform ceilings and model credentials | +| **Title** | Step isolation: network permissions, platform ceilings, credentials, approval authority and isolation class | | **Authors** | @agenticworkflowprotocol | | **Shepherd** | to be assigned (not an author, [aep-process 5.1](../docs/aep-process.md#51-review-before-acceptance)) | | **Type** | Specification | @@ -26,8 +26,14 @@ resolve to. Model credentials are not covered at all. This AEP defines the host effective network the intersection of the manifest and a platform ceiling, requires a runtime to enforce or reject, denies private and internal destinations after resolution by default under the `security` profile unless both the manifest and the ceiling allow them, defaults `egress` to `deny` -under that profile, and keeps model credentials out of steps. It answers runtime feedback G10, -G47, G49, G50, G51 and G61. +under that profile, and keeps model credentials out of steps. It extends the same rule to the +credentials of tool servers and to the authority that approves actions, lets a manifest require a +minimum isolation class, and states which ceilings reject and which cap. It answers runtime +feedback G10, G47, G49, G50, G51, G61, G64, G67, G68 and G69. + +All additions follow one principle: **what decides about a step, or what a step must not be able +to use, lives outside the step's execution environment.** Model credentials, tool server +credentials and approvals are the three cases a proof of concept met in practice. ## Motivation @@ -53,14 +59,36 @@ G47, G49, G50, G51 and G61. exfiltrate it (G61). - **Default `egress: allow`** conflicts with deny-by-default deployments and with the intent of the `security` profile. +- **Tool server credentials.** Spec 5.5.1 gives an MCP server `auth.secretRef`, and 7.9 lets the + secret's scope name the server: the runtime hands the credential to the MCP client. When the + client runs inside the step (a coding agent that speaks MCP itself), every command of the step + can read it (G69). A proof of concept therefore routes MCP traffic through a gateway outside the + step, which adds the credential and authenticates the step with a short-lived ticket. +- **Self-approval.** In interactive execution a person confirms single tool calls (AEP-0026), and + in workflows approvals gate actions (spec 7.6). If the component that asks for and records the + confirmation runs inside the execution environment, the step can confirm itself. A proof of + concept showed it: the coding agent and its commands ran under the same user ID, a command read + the agent's local server password from the process environment, and a process in the sandbox sent + a prompt in autonomous mode and answered every permission request itself. The attack failed only + after the decision moved to a separate container with its own process namespace, which signs + grants and takes confirmations only from the person's authenticated console (G64). +- **Isolation is invisible.** A step that runs commands on an untrusted repository needs more than + a container (a user-space kernel or a virtual machine). The manifest cannot require it; the + choice sits in a runtime binding that reviewers do not see (G67). +- **Reject or cap.** The proof of concept has ceilings per tenant for models, hosts, tool servers, + autonomy and cost. A model outside the ceiling makes the agent invalid, while a cost limit above + the ceiling is lowered to it. The specification says neither (G68). ## Goals and non-goals - Goals: one host syntax; a defined relation between manifest and platform ceiling; enforce or reject; safe defaults under `security`; internal destinations possible when explicitly - allowed; model credentials outside steps. -- Non-goals: a mechanism (proxy, mesh, policy engine); per-port or per-protocol firewall rules; - inbound traffic; secret stores (spec 7.9 stays as it is). + allowed; model and tool server credentials outside steps; approvals decided outside steps; a + minimum isolation class that reviewers can see; one rule for ceilings. +- Non-goals: a mechanism (proxy, mesh, policy engine, sandbox technology); per-port or + per-protocol firewall rules; inbound traffic; secret stores (spec 7.9 stays as it is); the + interactive execution form itself (AEP-0026); what data a step may send to a tool server + (runtime feedback G77). ## Specification @@ -127,10 +155,80 @@ command steps. A built-in tool can enforce in-process with a connection-time add - Outside the `security` profile, a runtime that exposes model credentials to steps MUST say so in its conformance statement. +### Changes to section 5.5.1 (MCP servers): credentials of tool servers + +- Credentials of tool servers (`auth` of an MCP server, credentials of remote agents) are subject + to the same rule as model credentials: under the `security` profile they MUST NOT be visible to + the step. The runtime calls the server itself, or the step reaches the server through a component + outside the step that adds the credential and authenticates the step with a credential that is + short-lived and bound to one execution or attempt. +- `auth` MAY be satisfied by the runtime (a catalog or binding that holds the credential) instead + of a manifest secret. The manifest still declares the server and the tools it may use. +- The component that holds the credential MUST also enforce the tool permissions of the step + (which tools are listed and which calls are allowed), because a step that talks to the server + directly is not bound by anything else. +- Traffic from the step to such a component is runtime-internal and does not need an + `allowHosts` entry. The tool server's own outbound traffic is not part of the step's + `permissions.network`; a runtime SHOULD restrict it as well and say how in its conformance + statement. + +### New section 7.6.1 (approval authority) + +Applies to approvals (spec 7.6, approval steps), to confirmations of single actions in interactive +execution (effect `ask`, AEP-0026) and to answers to human input that a runtime treats as a +decision. + +- Under the `security` profile, the component that decides whether an action may run, and that + records an approval or confirmation, MUST run outside the execution environment of the step. It + MUST accept a decision only from an authenticated identity over a channel that the execution + environment cannot reach. +- Anything that carries or proves a decision MUST NOT be readable or writable from inside the + execution environment: no passwords or tokens of an approval endpoint, no signing keys, no + pending requests that a process inside could answer. A signed grant that the step receives is + allowed if the step cannot produce one itself. +- A permission system inside the step (for example the one of a coding agent engine) MAY be used + in addition, but MUST NOT be the only enforcement. +- Separation of duties (spec 7.8) is checked against the authenticated identity of the decision, + never against an identity that the step asserts. + +Informative: a separate container with its own process namespace, which receives each tool call +before it runs, decides by mode, permissions and allow lists, and asks the person through the +runtime's user interface, is one conforming design. Running the decision in the same process or +under the same user ID as the step's commands is not. + +### Changes to section 5.4 (agents): isolation class + +| Field | Type | Description | +| ----- | ---- | ----------- | +| `isolation` | string | Minimum isolation of the execution environment of the agent's steps: `process`, `container`, `sandbox` (a kernel boundary in user space or an equivalent) or `vm` (a hardware-virtualised boundary). Default: none required. | + +- The values are ordered (`process` < `container` < `sandbox` < `vm`). A runtime MUST run the step + with at least the required class or reject the manifest or execution before any step runs. +- Which mechanism provides a class (for example gVisor for `sandbox`, Kata Containers or + Firecracker for `vm`) is platform configuration. A platform MAY also require a minimum class + through its ceiling; the stricter one applies. +- The conformance statement lists which classes the runtime provides and by which mechanism. + +### New section 7.5.7 (platform ceilings in general) + +7.5.6 defines the network ceiling. The same rules apply to every ceiling that a platform sets: + +- **Permissions, models, tool servers, autonomy and isolation**: the effective value is the + intersection of the manifest and the ceiling. If the manifest requires something that the + ceiling does not allow (a model, a host, a tool server, an autonomy level, an isolation class + below the platform minimum), the runtime MUST reject the manifest or execution before any step + runs, with a reason that names the rule. +- **Budgets**: a ceiling caps the manifest's limits. The effective limit is the lower one, and a + manifest without a limit gets the ceiling. A runtime MUST NOT reject a manifest only because its + budget is higher than the ceiling. +- A runtime SHOULD report the effect of a ceiling where the author can see it (status condition, + validation result). + ### Change to the profile table (spec 11) `security`: add "network enforcement or rejection (7.5.6), internal destinations (7.5.6), model -credentials outside steps (7.9)". +credentials outside steps (7.9), tool server credentials outside steps (5.5.1), approval +authority outside steps (7.6.1), isolation class enforced or rejected (5.4)". ## Examples @@ -162,6 +260,31 @@ spec: task: Triage new tickets. ``` +An agent that runs commands on untrusted repositories, with a tool server whose credential the +runtime holds: + +```yaml + agents: + - id: reviewer + isolation: sandbox + model: + provider: example-provider + name: example-model + tools: + - type: mcp + server: code-scanner # resolved from the runtime's catalog, no auth.secretRef + tools: [scan] + permissions: + default: deny + allow: + code-scanner.scan: true + shell.execute: true +``` + +A runtime that offers only containers rejects this agent. The step reaches `code-scanner` through +the runtime's gateway with a ticket for this attempt; the scanner's credential never enters the +step. + Under the `security` profile, a connection to `10.20.4.5` is allowed only if the platform ceiling also allows that address. If `api.example.com` resolves to `10.1.2.3`, the connection is allowed only if the ceiling allows `10.1.2.3`; with a ceiling that allows no internal addresses it @@ -172,16 +295,21 @@ is denied. - `allowHosts` items: a pattern for the four forms with optional port. - Semantic rule `permissions.network.host-invalid` for wildcards outside the first label, bare `*` and invalid CIDRs. +- `agents[].isolation`: enum `process`, `container`, `sandbox`, `vm`. ## Conformance impact - `core`: host syntax, enforce-or-reject, conformance statement. -- `security`: default `egress: deny`, internal destinations, model credentials. +- `security`: default `egress: deny`, internal destinations, model and tool server credentials, + approval authority, isolation class. +- Valid: `5.4-agent-isolation.yaml`. Invalid: `5.4-agent-isolation-unknown.yaml`. - Valid: `7.5.5-allow-hosts-forms.yaml`. Invalid: `7.5.5-allow-hosts-bare-wildcard.yaml`, `7.5.5-allow-hosts-inner-wildcard.yaml`, `7.5.5-allow-hosts-invalid-cidr.yaml`. - Runtime tests (once a runtime suite exists): a host that resolves to a private address; a redirect to `169.254.169.254`; a DNS answer that changes between two lookups; a ceiling that - forbids a required host (rejected before start). + forbids a required host (rejected before start); a process in the step that tries to read a + tool server credential; a process in the step that answers its own confirmation request; an + agent that requires `vm` on a runtime with containers only (rejected before start). ## Compatibility and migration @@ -190,6 +318,10 @@ is denied. - Under `security`, manifests without `network` change from "egress allowed" to "egress denied"; authors add `egress: allow` or `allowHosts`. - Runtimes that ignored `allowHosts` for command steps must enforce or reject. +- Under `security`, runtimes that pass `auth` of MCP servers into steps must move it to a gateway + or the runtime. Manifests stay valid; `auth.secretRef` becomes optional where the runtime + provides the credential. +- `isolation` is optional; existing manifests are unaffected. ## Security considerations @@ -198,6 +330,12 @@ keeps provider keys out of reach of prompt injection. Allowing internal destinat agreement of author (manifest) and operator (ceiling), so neither alone can open the internal network. +Pod or container isolation alone does not protect anything that lives inside the pod: a sandbox +keeps the step away from the node, not from the coding agent's own server, its permission system +or a credential in its environment. The additions for tool server credentials and approval +authority close that gap. A command allow list or approval does not restrict what an allowed +program runs (`make`, test runners); the isolation class is the boundary for that. + ## Privacy considerations None beyond spec 7.2. Host names in audit events may reveal which services a workflow uses. @@ -217,6 +355,12 @@ enforce their own compliance requirements. This proposal makes no compliance pro anywhere after a DNS change, which is the attack; the platform ceiling decides which internal addresses exist for a workload. - **Name a mechanism (proxy, network policy).** Rejected: not portable; kept as informative text. +- **Rely on the engine's own permission system for confirmations.** Rejected: it runs inside the + execution environment; a proof of concept bypassed it from a command of the same step. +- **Isolation only in the runtime binding.** Rejected: reviewers cannot see or require it, and a + binding change silently weakens it. +- **A separate AEP for approval authority.** Possible; kept here because the reason and the test + are the same as for credentials. Prior art (named under decision D21): [agent-sandbox](https://agent-sandbox.sigs.k8s.io/) (Kubernetes SIG Apps) provides isolated, stateful execution environments for agents on @@ -232,11 +376,38 @@ proxy, rejects workflow-level egress rules it cannot enforce for command steps, keys out of step pods (short-lived credential per attempt). It has no explicit DNS rebinding test and no measurement of proxy latency or cost. +The same runtime, extended to interactive sessions with a coding agent, shows the additions: + +- **Ceilings and egress.** An egress proxy per tenant with an allow list derived from the tenant + ceiling and the agent's `allowHosts`. It denies private, loopback, link-local and CGNAT + destinations after resolution, and a network policy lets the sandbox reach only that proxy and + the gateways. Models, hosts and tool servers outside the tenant ceiling reject the agent; cost + limits are capped. +- **Tool server credentials.** A static analysis server over MCP is reachable only through the + runtime's MCP gateway (network policy). The gateway accepts a session ticket or a step ticket, + hides tools that are not in the catalog, refuses calls to them, counts calls against the budget + and audits arguments and results. +- **Approval authority.** The self-approval attack described in the motivation succeeded while the + coding agent decided, and failed after the decision moved to a separate container. The same + command through the console produced exactly one confirmation and ran after "allow once". + Remaining limits: the engine's plugin runs in the engine process, and reading the session over + the local API stays possible. +- **Isolation class.** The class maps to a runtime class in a platform profile; only `container` is + deployed, so a stronger class is not shown. + ## Open questions 1. Should the ceiling be visible to authors, for example in the status of a binding or workflow - (`Accepted` with reason `NetworkCeiling`)? -2. Do MCP servers over `streamable-http` fall under the same rules as built-in tools? + (`Accepted` with reason `NetworkCeiling`)? The proof of concept reports it in the status of the + binding. +2. Do MCP servers over `streamable-http` fall under the same rules as built-in tools? Proposed + answer from the proof of concept: the step's connection to the server goes through a component + outside the step (5.5.1) and is runtime-internal; the server's own egress is restricted by the + runtime but is not part of the step's `permissions.network` (runtime feedback G77). +3. Are four isolation classes the right granularity, and should `sandbox` be defined by a + property (syscalls handled outside the host kernel) instead of an example? +4. Does approval authority belong here or in its own AEP, given that it also applies to approval + steps without any sandbox? ## Decision @@ -244,7 +415,9 @@ Not decided. Number and scope assigned by the maintainer on 2026-11-22. ## References -- Runtime feedback G10, G47, G49, G50, G51, G61 ([runtime-feedback.md](../docs/runtime-feedback.md)). -- Spec `v1alpha3` sections 7.5, 7.9, 11. +- Runtime feedback G10, G47, G49, G50, G51, G61, G64, G67, G68, G69 + ([runtime-feedback.md](../docs/runtime-feedback.md)). +- Spec `v1alpha3` sections 5.4, 5.5.1, 7.5, 7.6, 7.8, 7.9, 11. +- AEP-0026 (interactive execution, effect `ask`). - Kubernetes `NetworkPolicy`; RFC 1918, RFC 6598 (CGNAT), RFC 4193 (unique local IPv6). - agent-sandbox, Kubernetes SIG Apps. diff --git a/aep/0024-event-triggers.md b/aep/0024-event-triggers.md index a697775..2766c64 100644 --- a/aep/0024-event-triggers.md +++ b/aep/0024-event-triggers.md @@ -239,6 +239,18 @@ to create event runs itself from a trigger object generated from `spec.triggers` uses subscribes to MQTT with QoS 0. The thread limits of its bridge (30 entries, 12,000 characters) are set, not measured. +The same runtime, extended to a platform with interactive sessions, adds three data points: + +- **Deduplication confirmed.** A security scan workflow started by a CloudEvent over MQTT ran once; + a repeated delivery was rejected as a duplicate by `source` and `id`. +- **Events emitted by the runtime.** The runtime publishes CloudEvents about sessions (created, + ready, idle, resumed, finished, failed) and "waiting for a person" when a confirmation is + pending, so that chat bridges can notify people. AWP has no vocabulary for events that a runtime + emits about executions, only for events that start them (runtime feedback G62). +- **Event-started sessions (concept, not built).** An event could also start an interactive + session with an initial prompt. The actor question of G44 then decides who created the session + and who may control it: the attested person, not the bridge (runtime feedback G86). + ## Open questions 1. Is 24 hours the right minimum deduplication window? diff --git a/aep/0025-state.md b/aep/0025-state.md index 7e19279..5c4acc1 100644 --- a/aep/0025-state.md +++ b/aep/0025-state.md @@ -164,6 +164,18 @@ A proof-of-concept Kubernetes runtime provides one volume per workflow through i mounts it at `/awp/state`. Sharing between workflows and the conflict scenario are derived, not implemented. +Interactive sessions of the same runtime raise two more kinds of state: + +- **Workspace across pause and resume.** When a session pauses, the engine process ends; the + repositories, the engine's history and configuration stay on a volume and are used again on + resume. A running turn is cancelled. This is state of one execution rather than across + executions, but it has the same questions: classification (it contains the repository and every + prompt), retention after the session ends, and who may read it (runtime feedback G62, G85). +- **Shared workspace of several steps (concept).** Steps that plan, implement and review the same + change need one workspace, as Tekton workspaces provide. Today each engine step gets its own + empty directory. A declared store with an access mode per step would cover it, with the trust + boundary that a later step reads what an earlier agent wrote (runtime feedback G87, with G58). + ## Open questions 1. Should stores be their own kind (`State`) instead of a manifest field, so that ownership and diff --git a/docs/runtime-feedback.md b/docs/runtime-feedback.md index 04fd850..66a9ad6 100644 --- a/docs/runtime-feedback.md +++ b/docs/runtime-feedback.md @@ -28,7 +28,8 @@ portable runtimes, **should** needs a rule, **minor** is editorial or informativ 7. [From the operator](#7-from-the-operator) 8. [Event triggers](#8-event-triggers) 9. [From the concept review](#9-from-the-concept-review) -10. [Questions for the project lead](#10-questions-for-the-project-lead) +10. [From interactive sessions and a coding agent engine](#10-from-interactive-sessions-and-a-coding-agent-engine) +11. [Questions for the project lead](#11-questions-for-the-project-lead) ## 1. Status overview @@ -36,9 +37,11 @@ portable runtimes, **should** needs a rule, **minor** is editorial or informativ | --- | --- | | Accepted and applied to `v1alpha2` and `v1alpha3` | G23 ([AEP-0022](../aep/0022-step-iteration.md), decision D19) | | AEP drafted and applied to the `v1alpha3` draft (Draft, not accepted) | G01, G07, G08, G40; partly G14, G15 | -| AEP drafted, not applied | G10, G47, G49, G50, G51, G61 (AEP-0023); G42 to G46, G54, G56 (AEP-0024); G03, G53, G58 (AEP-0025) | +| AEP drafted, not applied | G10, G47, G49, G50, G51, G61, G64, G67 to G69 (AEP-0023); G42 to G46, G54, G56, G86 (AEP-0024); G03, G53, G58, G87 (AEP-0025) | +| New AEP proposed (number to be confirmed) | G62, G63, G73, G82, G85 (AEP-0026, interactive execution); G65, G66, G81, G83 (AEP-0027, agent engine) | +| Fits an existing AEP that is not applied yet (from section 10) | G70 to G72 (AEP-0007); G74 (AEP-0002); G75 (AEP-0005); G76 (AEP-0009); G78 (AEP-0013); G84 (AEP-0017) | | Covered by an existing AEP that is not applied yet | G02, G04, G06, G22; G41 (AEP-0004); G48, G57 (AEP-0019 open question 1); G52 (AEP-0021); G55 (AEP-0012); G59, G60 (AEP-0008) | -| Open, needs a decision whether and how | G05, G09, G11, G12, G13, G16 to G21, G24 to G39, K | +| Open, needs a decision whether and how | G05, G09, G11, G12, G13, G16 to G21, G24 to G39, G77, G79, G80, K | ## 2. Step interface @@ -170,7 +173,7 @@ change would fit. | --- | --- | --- | --- | --- | --- | | G48 | must | Event runs created by an external router (an event router creating run objects) fit neither role of spec 10.8: client-created runs are manual, runtime-created runs record the trigger only in status, and the run spec has no trigger. | A trusted-ingress role: an authenticated identity the runtime accepts may create runs with trigger type `event` and an event payload; the runtime checks the trigger against the manifest, records the ingress identity and rejects event fields from other creators. | AEP-0019 open question 1 | open; the runtime now plans to create event runs itself from a generated trigger object, which needs no new role; the role stays relevant for external routers | | G49 | should | `permissions.network.allowHosts` has no syntax: subdomain wildcards, ports, IP literals and CIDRs are undefined. | Define host matching (exact, `*.domain`), optional ports, and whether addresses or CIDRs are allowed. | [AEP-0023](../aep/0023-step-isolation.md) | AEP drafted | -| G50 | must | An allowed host can resolve to loopback, private, link-local (cloud metadata) or CGNAT addresses (SSRF, DNS rebinding); the proof of concept had this hole. | Under the security profile, deny such destinations after resolution unless listed explicitly as addresses. | [AEP-0023](../aep/0023-step-isolation.md) | AEP drafted; the proof of concept now checks the resolved address at connection time (covers rebinding and redirects by construction), without an explicit rebinding test | +| G50 | must | An allowed host can resolve to loopback, private, link-local (cloud metadata) or CGNAT addresses (SSRF, DNS rebinding); the proof of concept had this hole. | Under the security profile, deny such destinations after resolution unless listed explicitly as addresses. | [AEP-0023](../aep/0023-step-isolation.md) | AEP drafted; the proof of concept now checks the resolved address at connection time (covers rebinding and redirects by construction), without an explicit rebinding test. Second enforcement point: the egress proxy of every tenant and of a tool server deny private, loopback, link-local and CGNAT destinations after resolution, and the network policy of the proxy excludes them as well | | G51 | should | No guidance on how `permissions.network` is enforced for command steps. | Informative: a per-workload egress proxy with an allowlist derived from `allowHosts`, plus a network policy that allows only that proxy, is conforming. A runtime that cannot enforce a network rule rejects the workflow. | [AEP-0023](../aep/0023-step-isolation.md), with G10 | AEP drafted | | G52 | should | AEP-0021 B6 covers bindings but not runtime trigger objects (routing, expression filters, rate limits). | Trigger objects attach with `targetRefs` and `sectionName` (trigger index), may only narrow the manifest trigger, are generated from or validated against `spec.triggers`, and report `Accepted`. | AEP-0021 (extend B6) | open | | G53 | should | Two workflows of one owner share state (a daily run writes, a chat run reads and writes). | State as a named resource referenced by several workflows with an access mode, rules for concurrent writers, and the strictest classification for every reader. | [AEP-0025](../aep/0025-state.md), with G03 | AEP drafted; scenario derived, no conflict observed | @@ -180,14 +183,83 @@ change would fit. | G57 | should | Event-only workflows cannot be tested conformingly: AEP-0004 fails `event.*` outside event runs, and 10.8 makes client runs manual. | A client run with a supplied event, marked as test or replay (actor is the creator), validated against `dataSchema`. | AEP-0019 open question 1, AEP-0004 | open | | G58 | should | State written by one execution is read as data by the next, so a message or web page can become a persistent instruction (memory poisoning, seen in the chat workflow). | Origin marking (G11) also for state; state is untrusted input by default. | [AEP-0025](../aep/0025-state.md); spec 12 now lists state as untrusted input | AEP drafted | | G59 | should | AEP-0008 treats `contextTokens` and `maxOutputTokens` as informative; a model server rejected every request because the runtime asked for more output tokens than the model allows. | Catalog limits are binding: the runtime caps requested output tokens at `maxOutputTokens` and rejects a workflow whose settings cannot fit. A price of 0 (local models) counts as a known price (G35). | AEP-0008 (its target `v1alpha3` predates D20 and now means after the current draft), with G34 | open | -| G60 | minor | Agent steps need a model that supports tool calls; a small local model called tools without arguments, and the failure showed only at run time. | Optional capability flags in the catalog model entry (`toolUse`, `structuredOutput`); a runtime rejects an agent with tools on a model without tool support. | AEP-0008 | open | +| G60 | minor | Agent steps need a model that supports tool calls; a small local model called tools without arguments, and the failure showed only at run time. | Optional capability flags in the catalog model entry (`toolUse`, `structuredOutput`); a runtime rejects an agent with tools on a model without tool support. | AEP-0008 | open; a coding agent engine (section 10) also needs context size, output limit and input types (image, document) from the catalog, otherwise it does not compact the context or rejects input | | G61 | should | The spec does not say where model credentials live; a runtime may hand the provider key to the step, where any command or injected instruction can read it. | Under the security profile, model credentials MUST NOT be visible in the step environment; the runtime calls the provider itself or through a proxy that authenticates the step with a short-lived, execution-bound credential. | [AEP-0023](../aep/0023-step-isolation.md); not AEP-0008, whose non-goals exclude credentials | AEP drafted; feasibility shown (key only at the runtime, short-lived credential per attempt), latency and cost of the proxy not measured | **Conflict in the draft (G44).** Spec 5.2 gives every `event` start the actor type `system`, while G44 asks to record a person attested by the event source. Both cannot hold; 10.8 avoids the question only because runtime-created runs record the trigger in status. -## 10. Questions for the project lead +## 10. From interactive sessions and a coding agent engine + +Reported after the same runtime was extended to a platform. People start interactive sessions +with a coding agent in a browser console (sign-in through OpenID Connect, tenants with ceilings). +The coding agent runs in an isolated pod without model or tool credentials. A model gateway and an +MCP gateway outside the pod hold the credentials, meter the budget and write the audit trail. +Egress goes through a proxy per tenant. The same coding agent also runs agent steps of workflows +as an engine. A security review that scans a deliberately vulnerable repository with a static +analysis server over MCP and fixes the findings ran end to end, interactively and as an +event-triggered workflow. "Shown" in the status column means that it ran on the test installation, +not only in unit or integration tests. + +The common thread of this section is one question that AWP does not ask yet: **does something +live inside or outside the execution environment?** Credentials (G61, G69), approvals (G64) and +audit events (G76) are trustworthy only when they are outside it. Two sessions showed this in +practice. A command read the coding agent's local server password from `/proc` because both run +under the same user ID. A process in the sandbox then answered its own permission request. It +failed only after the decision moved to a separate container. + +| ID | Sev. | Gap | Proposal from the runtime | Home | Status | +| --- | --- | --- | --- | --- | --- | +| G62 | must | Interactive execution. Spec 6 runs a standalone agent as a workflow with one step. A session has no task and no outputs: a person sends prompts for hours, the session pauses when idle, resumes, and ends when the person stops it. Its lifecycle, budget scope and audit events (created, idle, resumed, waiting for a person, finished) are undefined. | An execution form `Session` next to `WorkflowRun`, with lifecycle, budget scope and events. | new AEP: [AEP-0026](../aep/0026-interactive-execution.md) | shown; the runtime treats a whole session as one execution for permissions, budget and audit | +| G63 | must | Permissions are only `allow` or `deny`. In a session a person confirms single tool calls and switches between read-only, confirm-each-call and autonomous during the session. AWP says neither who may switch nor whether an author can forbid autonomy, and confirmations are neither approvals nor audited. | An effect `ask` for interactive execution. An autonomy ceiling in the manifest that the platform can only lower. Audit events for confirmed and refused calls and for mode changes. | AEP-0026 | shown | +| G64 | must | Approval authority inside the execution environment. The engine and its commands share a user ID: a command read the engine's server password and could answer its own permission requests. A process in the sandbox sent a prompt with the autonomous mode and answered every question itself. | Under the `security` profile, confirmations and approvals are decided outside the execution environment, by an authenticated person, over a channel the environment cannot reach. Nothing that carries an approval (passwords, tokens, signed grants) is readable inside. | [AEP-0023](../aep/0023-step-isolation.md) | shown: the attack succeeded while the engine decided, and failed after the decision moved to a separate container with signed grants; the counter-test through the console asked once and ran after "allow once" | +| G65 | must | Engine of an agent. A coding agent brings its own tool loop, file editing and shell use. No field says which engine runs an agent, what it receives and produces, how permissions map to it, or whether its subagents inherit permissions and budget. The runtime uses an extension field. | `agents[].engine` (`type`, `runtimeProfile`, `repositories`, `push`). Allow or deny only when unattended. A refused call fails the step. Subagents inherit permissions and budget. Unknown engines are rejected. | new AEP: [AEP-0027](../aep/0027-agent-engine.md); until then `extensionRef` ([AEP-0021](../aep/0021-extension-model.md) B3) | shown: a workflow ran its review step with the engine, started by hand and by an event | +| G66 | should | Engine steps produce only a summary and a diff. A step that declares outputs such as `critical` and `high` is rejected, and its repositories are fixed, so an event cannot pass one. | The engine fills declared outputs through the completion tool of AEP-0018 with the schema of AEP-0003. `repositories` is expression-enabled with `inputs.*` and `event.*`. | AEP-0027 | shown (the rejection) | +| G67 | should | Agents that run untrusted code need stronger isolation than a container. The manifest cannot require it: the runtime class sits in the binding, invisible to reviewers. | A minimum `agents[].isolation` (`container`, `sandbox`, `vm`) that a runtime meets or rejects. The mechanism is platform configuration. | AEP-0023 | mapping implemented; no class above `container` deployed | +| G68 | should | Ceilings. AEP-0023 defines a network ceiling, but not whether ceilings reject or cap. The runtime rejects models, hosts and MCP servers outside its tenant ceiling and caps cost. Tenants also limit tool sources, autonomy and concurrent sessions. | Ceilings on permissions, models, tool sources, autonomy and isolation reject. Budget ceilings cap the manifest's limits. Rejection is visible in status. | AEP-0023 | shown | +| G69 | should | MCP credentials. Spec 5.5.1 `auth.secretRef` hands the credential to the MCP client. When the client is a coding agent in a sandbox, the agent and every command can read it. | Under the `security` profile, tool server credentials stay outside the execution environment, like model credentials (G61). A gateway authenticates the execution with a short-lived ticket, and `auth` may be satisfied by the runtime. | AEP-0023 | shown: the static analysis server is reachable only through the gateway, with a session ticket and a step ticket | +| G70 | should | Resolution of MCP servers from runtime configuration (5.5.1). The order, partial declarations and substitution are undefined. | Resolve declaration first, then binding, then catalog. A declaration and the resolved server must not contradict each other. | [AEP-0007](../aep/0007-mcp-connection-catalog.md) | implemented, integration tests | +| G71 | should | `server.*` also allows tools that a server adds after the review, and unattended steps run them unseen. | An explicit tools list for unattended executions. Tool annotations are untrusted unless the platform pins the server. | AEP-0007 | shown: the catalog hides two tools of the server, and calls to them are refused | +| G72 | should | MCP prompts, resources and server requests (sampling, roots, elicitation) are not covered. An engine shows server prompts as commands without any rule of the manifest. | Allow lists for `prompts` and `resources`, default none. No relay of sampling or roots unless allowed; elicitation is declined. This answers AEP-0007 open question 3. | AEP-0007 | shown (one prompt and rule resources of the analysis server) | +| G73 | should | Tool sources are fixed per manifest, so a person cannot enable only some of them for one execution. The alternative is one reviewed manifest per combination. | A runtime MAY narrow the tool sources of an execution, never widen them. The narrowing is recorded in the audit. | spec 5.5, AEP-0026 | shown | +| G74 | should | `shell.execute` has no resource format (7.5.2), but a command line chains, substitutes and nests commands. | The resource is each simple command. Lines that cannot be split are denied. An allow list does not restrict what an allowed program runs (`make`, `npm test`). | [AEP-0002](../aep/0002-tool-argument-constraints.md) | shown: `echo` and `git --version` ran; `curl`, `echo a; id` and `echo $(id)` were refused | +| G75 | minor | There is no reusable prompt outside a workflow step. The runtime offers shared prompts to sessions as commands. | `Prompt` ([AEP-0005](../aep/0005-prompt-kind.md)) also serves as a task of an interactive execution. It is plain user input, grants nothing and may suggest a mode. | AEP-0005 | implemented | +| G76 | should | Audit events can come from the engine (inside), the user interface or the model gateway (outside). AWP does not say which source is trustworthy. | Events about model calls SHOULD come from the component that holds the credentials. Every event carries its origin. | [AEP-0009](../aep/0009-audit-payload-levels.md) | shown (gateway audit with a hash chain per conversation) | +| G77 | should | Data flow to tool sources. A scan tool receives source code as an argument. Nothing says which data may go to which source (in the cluster or external), and the tool server's own egress is outside `permissions.network`. | Allowed data classes per tool source, and logging of the passed content with its own retention. The source's own network limit is runtime guidance. | open (5.5, 7.2, AEP-0009) | shown: arguments in the audit, the server's egress only through its own proxy | +| G78 | should | Budgets during streaming. Providers report usage at the end of a stream. The runtime estimates and aborts, so a session can end slightly above `maxCostUsd`. | Budgets are hard limits that the last call may exceed. Estimates during a call are allowed. With G35. | [AEP-0013](../aep/0013-runtime-clarifications.md) | implemented, overshoot not measured | +| G79 | should | A person brings a secret when starting an execution (a personal token). The manifest can neither express nor restrict this. | `secretsPolicy` on agents and workflows. Secrets supplied at start fall under the same MUSTs as declared ones. With G05 and G36. | spec 7.9 | shown: a secret value reached the model only as a placeholder | +| G80 | minor | A standalone `Agent` has no agent id for the secret `scope`. | A scope value `self`, or `metadata.name` as the id. | spec 7.9 | implemented | +| G81 | must | Repository content as instructions. Repositories bring agent instruction files, skills, commands and tool manager configuration with environment variables, and an engine loads them by default. | Configuration from workspace content is off unless the manifest allows it explicitly, and it is untrusted input. | AEP-0027, spec 12 | implemented (disabled in the engine) | +| G82 | should | An agent has exactly one model, but sessions pick from alternatives that the binding and the tenant allow. | Model alternatives or a model policy on `Agent`, intersected with ceilings. | AEP-0026, spec 7.4 | implemented | +| G83 | should | A workspace has several repositories with clone credentials, and the credential must not reach the engine. Extends G12. | `workspace.repositories`. Git credentials stay outside the execution environment, like G61. | AEP-0027, with G12 | implemented; private repositories not shown | +| G84 | should | The agent asks a person questions during interactive work. Behaviour without a person is undefined. | AEP-0017 covers sessions. Without a person, questions are declined. Answers are no approvals. | [AEP-0017](../aep/0017-human-input.md) | implemented (audited answers) | +| G85 | should | The history of an interactive execution after it ends: its content, read access, retention and tamper evidence. | History is audit content with its own retention. | AEP-0009, AEP-0026 | in progress | +| G86 | should | The actor of a session started by an event. Extends G44 and G48. | The same attested actor as in G44. Define the creator and who may control the session. | [AEP-0024](../aep/0024-event-triggers.md) | concept | +| G87 | should | Several steps or agents share one workspace (plan, implement, review). | Workspaces with an access mode per step, under AEP-0025, and the trust boundary in spec 12. | [AEP-0025](../aep/0025-state.md) | concept | + +Not numbered: messages between running agents of one runtime (concept only). Engines also need +context size, output limit and input types from the model catalog; this is evidence for G60. + +**Which objects should become AWP kinds (extends K).** The platform needed nine custom resources. +For each one the question was whether it should be an AWP kind or stay with the runtime. Rule: an +object becomes an AWP kind if an author or reviewer governs it and it must mean the same on every +runtime. It stays implementation-specific if it says how a platform realises something, and then +attaches with `targetRefs` or `parametersRef` (AEP-0021 B5, B6). + +| Object in the proof of concept | Proposal | Reason | +| --- | --- | --- | +| Session object | AWP kind `Session` (AEP-0026), sibling of `WorkflowRun` | An execution that people start, pause and stop. Its spec fields (agent, repositories, mode, tool source selection, model choice) are governed and portable. | +| Run object | AWP `WorkflowRun` (AEP-0019) | Built only because the draft was not applied yet. | +| Prompt library | AWP `Prompt` (AEP-0005), extended for sessions | Reviewed content, the same on every runtime. | +| MCP server catalog entry | split: catalog facts (tools, prompts, resources, allow lists) in `McpCatalog` (AEP-0007); endpoint and credentials in runtime configuration | The same split as `ModelCatalog` and provider configuration (AEP-0008, G59). | +| Model provider | split as in AEP-0008 | Prices and limits are facts. The endpoint and credentials are deployment data. | +| Agent and workflow bindings | implementation-specific, `targetRefs` (AEP-0021 B6) | Placement, images, secret mapping. AEP-0021 B6 should also allow `Agent` targets. | +| Tenant | implementation-specific | Tenancy, sign-in groups and quotas are platform matters. AWP defines what a ceiling may restrict and how a rejection is reported (G68), not the object that holds it. | +| Sandbox profile | implementation-specific, behind `agents[].isolation` (G67) | Like `StorageClass` or `RuntimeClass`: the manifest asks for a class, the platform maps it to a mechanism. | +| Gateways, proxies | not an object of AWP | Mechanisms. AWP states only the property they provide (outside the execution environment). | + +## 11. Questions for the project lead 1. Do the three drafted AEPs (G01, G07, G08) join the `v1alpha3` scope table in the decision log, once they reach `Review`? @@ -208,3 +280,9 @@ the question only because runtime-created runs record the trigger in status. [AEP-0023](../aep/0023-step-isolation.md) (G10, G47, G49 to G51, G61). Internal destinations are denied by default under the security profile, not banned: the manifest and the platform ceiling can allow them. State gets [AEP-0025](../aep/0025-state.md) (G03, G53, G58). +10. G62 to G87 (section 10): confirm the two new AEP numbers, AEP-0026 (interactive execution) + and AEP-0027 (agent engine), and that G64, G67, G68 and G69 extend AEP-0023 rather than + getting an AEP of their own. +11. Which objects become AWP kinds (section 10): `Session` as a new kind, `Prompt` and + `McpCatalog` as already proposed, and tenants, sandbox profiles and bindings left to the + runtime? From 7d4cb500d6ccaa62618b8517e4b3c9c7be687dac Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Mon, 23 Nov 2026 16:18:18 +0100 Subject: [PATCH 09/14] docs(aep): interactive execution and agent engine as AEP-0026 and AEP-0027 AEP-0026 adds the kind AgentSession next to WorkflowRun, autonomy levels with a ceiling set by the author, confirm per action and the session events. AEP-0027 adds agents[].engine for coding agents with workspace configuration off by default and declared outputs filled by the engine. Both numbers are to be confirmed. Signed-off-by: Simon Lauger --- aep/0026-interactive-execution.md | 348 ++++++++++++++++++++++++++++++ aep/0027-agent-engine.md | 250 +++++++++++++++++++++ spec/README.md | 4 +- 3 files changed, 601 insertions(+), 1 deletion(-) create mode 100644 aep/0026-interactive-execution.md create mode 100644 aep/0027-agent-engine.md diff --git a/aep/0026-interactive-execution.md b/aep/0026-interactive-execution.md new file mode 100644 index 0000000..b542029 --- /dev/null +++ b/aep/0026-interactive-execution.md @@ -0,0 +1,348 @@ +# AEP-0026: Interactive execution + +| | | +| --- | --- | +| **AEP** | 0026 | +| **Title** | Interactive execution: the `AgentSession` kind, autonomy levels and per-call confirmation | +| **Authors** | @agenticworkflowprotocol | +| **Shepherd** | to be assigned (not an author, [aep-process 5.1](../docs/aep-process.md#51-review-before-acceptance)) | +| **Type** | Specification | +| **Status** | Draft | +| **Reviewer roles needed** | runtime implementer (Kubernetes operator), runtime implementer (non-Kubernetes), security reviewer, user interface implementer | +| **Reviewers** | none yet | +| **Target API version** | `v1alpha3` | +| **Profiles affected** | `core`, `security`, `audit`, new profile `session` | +| **Created** | 2026-11-23 | +| **Discussion** | issue to be opened | +| **Supersedes** | - | +| **Superseded-by** | - | + +## Summary + +AWP describes one execution form: a workflow run with a task, steps and outputs. People also use +agents interactively. A person opens a session with a coding agent, sends prompts for hours, +confirms single tool calls, switches between read-only and autonomous work, pauses and resumes. A +runtime can run this today only by pretending a session is a workflow with one step (spec 6). This +AEP adds an execution form for that: the kind `AgentSession`, a sibling of `WorkflowRun`. It also +adds autonomy levels with a ceiling that the agent's author sets, a per-action `confirm` setting, +the lifecycle, budget scope and audit events of a session, and the narrowing of tool sources and +the choice of a model for one session. It answers runtime feedback G62, G63, G73, G82 and part of +G85. + +## Motivation + +- **No execution form (G62).** A session has no task and no outputs. It is driven by prompts, it + pauses when idle and resumes later, and it ends when a person stops it. Budget, permissions and + audit must still apply. A proof-of-concept runtime built its own session object and treated the + whole session as one execution. Another runtime would build a different one, and a reviewer of + an `Agent` manifest cannot tell what an interactive use of it may do. +- **Only allow or deny (G63).** In a session the person confirms individual actions (a shell + command, an edit, a web request) as the agent proposes them, and switches the level during the + session: read-only for planning, confirm each call, or autonomous. AWP approvals (spec 7.6) are + workflow steps with approvers, and human input (spec 5.8) is information, not a decision. + Neither fits one click on one tool call. Nothing lets an author say that an agent must never run + autonomously, or that `git.push` always needs a confirmation. Without that, a platform can grant + autonomy to an agent whose author did not intend it. +- **Tool sources per execution (G73).** A person wants a session that reaches the code host but + not the ticket system, although the reviewed agent may use both. Today that takes a second + reviewed manifest. +- **Model choice (G82).** Sessions pick a model per task (a small one for questions, a large one + for refactoring) from alternatives that the agent and the platform allow. An `Agent` has exactly + one model. +- **Self-approval.** The confirmations of a session are only worth something if the session cannot + give them itself. AEP-0023 section 7.6.1 states that rule. This AEP relies on it. + +## Goals and non-goals + +- Goals: an execution object for interactive use of an `Agent`; autonomy levels and a ceiling + in the manifest; confirmations that are audited and cannot come from the execution environment; + lifecycle, budget and events; narrowing, never widening, of tool sources and model. +- Non-goals: the user interface; the transport between person and runtime; how an engine runs the + agent (AEP-0027); workspaces and repositories (AEP-0027, AEP-0025); a chat history format; + messages between running agents. + +## Specification + +### Changes to section 6 (kind `Agent`) + +Replace "Runtimes MAY offer a way to run a single agent; they MUST then treat it as a workflow with +one agent step" with: "Runtimes MAY run a single agent as a workflow with one agent step, or +interactively as an `AgentSession` (section 10.9) if the agent allows it." + +New `spec` field of `Agent`: + +| Field | Type | Req. | Description | +| ----- | ---- | ---- | ----------- | +| `sessions` | object | no | Whether and how the agent may run interactively. Absent: the agent MUST NOT run as an `AgentSession`. | +| `sessions.maxAutonomy` | string | no | Highest autonomy level (section 7.5.8): `readOnly`, `ask` (default) or `auto`. | +| `sessions.models` | list | no | Alternatives to `model` that a session may choose, model objects as in [section 5.4.3](../spec/v1alpha3/README.md#543-model-object). `model` stays the default. | +| `sessions.idleTimeout` | duration | no | Time without a prompt after which the runtime pauses the session. Default: implementation-defined, stated in the conformance statement. | +| `sessions.maxDuration` | duration | no | Time after which the runtime ends the session, paused time not counted. | + +A session is not possible without the explicit opt-in of the author, because interactive use +changes what the agent does more than any input value. + +### New section 7.5.8 (autonomy and confirmation) + +**Autonomy level.** Each prompt of a session runs at one level: + +| Level | Meaning | +| ----- | ------- | +| `readOnly` | Actions that change the workspace or external state are denied. Other allowed actions require a confirmation. | +| `ask` | Every allowed action requires a confirmation, except actions with `confirm: never`. | +| `auto` | Allowed actions run without confirmation, except actions with `confirm: always`. | + +Which actions change state is defined per action group; a runtime that cannot tell treats an +action as changing state. Permissions (7.5.4) decide first: a denied action is denied at every +level, and no level allows an action that permissions deny. + +**`confirm` on a permission entry.** New optional value in `tools` entries (7.5.1): + +| Value | Meaning | +| ----- | ------- | +| absent | Follows the autonomy level. | +| `always` | Requires a confirmation at every level. In executions without a person (workflow runs) the action is denied. | +| `never` | Runs without confirmation at `ask` and `auto`; still denied at `readOnly` if it changes state. | + +When several permission objects apply, the strictest `confirm` wins (`always` over absent over +`never`). + +**Effective level.** The level that applies to a prompt is the lowest of: the level that the person +selected, `sessions.maxAutonomy`, and the platform ceiling (AEP-0023 section 7.5.7). Only an +identity that may control the session (section 10.9) may change the level. Every change is an +audit event. + +**Confirmation.** A confirmation names the action, its arguments as the runtime shows them, and +the outcome: `allowOnce`, `allowForSession` (the same action and resource for the rest of the +session, never beyond it) or `refuse`. A confirmation is a decision under AEP-0023 section 7.6.1: +it MUST come from an authenticated identity that may control the session, and MUST be decided +outside the execution environment. A confirmation is not an approval in the sense of spec 7.6: +rules that require an approval (`requireApproval`, approval steps) still require one. + +### New section 10.9 (kind `AgentSession`) + +An `AgentSession` is one interactive execution of an `Agent`. Like `WorkflowRun`, it has no +governance fields of its own: governance belongs to the agent it runs and to the policies that +apply. + +```yaml +apiVersion: awp.agenticworkflowprotocol.org/v1alpha3 +kind: AgentSession +metadata: + generateName: security-review- + namespace: team-a +spec: + agentRef: + name: security-reviewer + version: 0.3.0 + autonomy: ask + model: + provider: example-provider + name: example-model-large + toolSources: [code-scanner] + initialPrompt: Review the repository for injection flaws and fix the critical ones. +``` + +| Field | Type | Req. | Description | +| ----- | ---- | ---- | ----------- | +| `spec.agentRef` | object | yes | `name` of an `Agent` in the same namespace; `version` and `digest` are assertions as in `WorkflowRun`. | +| `spec.autonomy` | string | no | Level the person selected: `readOnly`, `ask` (default) or `auto`. Capped as in 7.5.8. May change while the session runs. | +| `spec.model` | object | no | `model` or one of `sessions.models` of the agent. Anything else is rejected. May change between prompts. | +| `spec.toolSources` | list | no | Names of the agent's tool sources to enable. Absent: all. Empty list: none. A name that is not a tool source of the agent is reported in status and ignored. | +| `spec.initialPrompt` | string | no | First prompt, sent when the session is ready. | +| `spec.promptRef` | object | no | A `Prompt` (AEP-0005) used as the first prompt instead of `initialPrompt`. | +| `spec.environment` | string | no | Target environment (spec 7.10). | +| `spec.paused` | boolean | no | `true` asks the runtime to pause the session. | +| `spec.stop` | boolean | no | `true` ends the session for good. | +| `status` | object | no | Written by the runtime, see below. | + +Rules: + +- **Starting.** The creator of the object is the actor. It is taken from an authenticated source, + as for `WorkflowRun`. The runtime validates the agent (including `sessions`), the model, the + tool sources, the autonomy level and every policy before it starts anything. Otherwise it sets + `phase: rejected`. +- **Control.** The creator may send prompts, confirm actions, change level and model, pause, resume + and stop. A runtime MAY let further identities control a session (for example a team + maintainer), and MUST document who. Every action of a controlling identity is an audit event with + that identity. A prompt is user input: it cannot change permissions, policies or budgets. +- **Narrowing only.** `toolSources` and `model` can only select from what the agent declares, + intersected with the platform ceiling. A runtime MUST NOT offer a tool source that is not + enabled. Calls to such a source are refused, and its permissions are irrelevant for this + session. If a change cannot take effect while the session runs, the runtime reports this in + status and applies the change on the next resume. +- **Idle and pause.** The runtime pauses a session after `idleTimeout` and on `paused: true`. A + turn that is still running is cancelled. A paused session keeps its workspace and history, uses + no model calls, and resumes on `paused: false` or a new prompt. +- **Budgets.** The agent's `budget` applies to the whole session across pauses: cost, tokens and + model calls are summed over all prompts. `maxDuration` of the budget counts active time only. A + session that reaches a budget limit ends with reason `budgetExceeded`. +- **Ending.** A session ends on `stop: true`, on deletion, at `sessions.maxDuration` or at a budget + limit. Deleting the object MUST NOT delete audit events. What the runtime keeps of the workspace + and history after the end, and for how long, is stated in the conformance statement (see open + question 3). +- **One execution.** A session has one execution id (spec 10.1) for its whole life. All audit events + of all prompts carry it. + +**Status** (`AgentSessionStatus`): `executionId`, `phase` (`pending`, `ready`, `working`, +`waiting`, `paused`, `finished`, `failed`, `rejected`), `reason`, `message`, `actor`, `agent` +(`name`, `version`, `digest` as pinned), effective `autonomy` and `model`, `toolSources` (enabled +and ignored names), `pendingConfirmations` (count, never arguments), `usage`, `startedAt`, +`lastActivityAt`, `finishedAt`, `conditions` (`Accepted`, `Ready`). `status` MUST NOT contain +prompts, answers, tool arguments or secret values. `waiting` means a confirmation or a question to +a person is pending. + +### Changes to section 10.4 (event types) + +| Event | When | +| ----- | ---- | +| `session.started`, `session.ready`, `session.paused`, `session.resumed`, `session.finished`, `session.failed` | Lifecycle. | +| `session.prompt` | A prompt was sent (actor, length; content only at the payload level of AEP-0009). | +| `session.autonomy.changed`, `session.model.changed`, `session.toolSources.changed` | A controlling identity changed the session (actor, from, to). | +| `action.confirmationRequested` | The runtime asks a person to confirm an action. | +| `action.confirmed`, `action.refused` | The outcome, with the identity that decided and the scope (`once`, `session`). | + +These events SHOULD come from the component outside the execution environment that decides +(AEP-0023 section 7.6.1, runtime feedback G76). + +### Profile `session` (spec 11) + +New profile: `AgentSession`, `sessions` on `Agent`, autonomy levels, `confirm`, the events above. +Under `security`, AEP-0023 section 7.6.1 applies to confirmations. + +## Examples + +An agent that may run interactively, never fully autonomously, with a confirmation for every push: + +```yaml +apiVersion: awp.agenticworkflowprotocol.org/v1alpha3 +kind: Agent +metadata: + name: security-reviewer +spec: + version: 0.3.0 + owner: + team: appsec + classification: internal + model: + provider: example-provider + name: example-model + sessions: + maxAutonomy: ask + models: + - provider: example-provider + name: example-model-large + idleTimeout: 30m + tools: + - type: mcp + server: code-scanner + tools: [scan] + permissions: + default: deny + tools: + code-scanner.scan: + allow: true + confirm: never + shell.execute: + allow: true + resources: ["git *", "ls *", "python -m pytest*"] + git.push: + allow: true + confirm: always + budget: + maxCostUsd: 5 +``` + +A person who selects `auto` gets `ask` (the ceiling). Scans run without asking. A `git push` asks +every time. `curl` is denied. + +## Schema changes + +- New root kind `AgentSession` with `$defs/AgentSessionSpec`, `$defs/AgentSessionStatus`. +- `$defs/AgentSpec.sessions`; `confirm` enum in `$defs/PermissionToolEntry`. +- Semantic rules: `session.agent-not-interactive` (no `sessions`), `session.model-not-allowed`, + `session.autonomy-invalid`, `permissions.confirm-invalid`. +- Kubernetes binding (spec 3.10): plural `agentsessions`, namespaced, `status` subresource. + +## Conformance impact + +- New profile `session`. Valid: `10.9-agent-session.yaml`, `6-agent-sessions.yaml`. Invalid: + `10.9-agent-session-model-not-allowed.yaml`, `7.5.8-confirm-unknown.yaml`. +- Runtime tests: a level above `maxAutonomy` is capped; `confirm: always` asks at `auto`; a + disabled tool source is refused; a confirmation sent from inside the execution environment is + not accepted; the budget is summed across a pause. + +## Compatibility and migration + +Compatible: new kind and optional fields. Runtimes that run single agents as one-step workflows +keep doing so. A runtime that offered interactive use without this AEP needs the agent's +`sessions` opt-in once it implements the profile. + +## Security considerations + +- The value of a confirmation depends entirely on AEP-0023 section 7.6.1. A runtime that lets the + agent's own permission system ask the person, inside the sandbox, offers no protection against a + command that answers for the person. +- `allowForSession` can turn into a broad grant. It is limited to the same action and resource, + and it ends with the session. +- A command allow list (AEP-0002) and confirmations do not restrict what an allowed program runs. + The isolation class (AEP-0023) is the boundary for that. +- Prompts and repository content are untrusted input (spec 12, runtime feedback G81). A prompt + that asks the agent to raise its own level has no effect, because only a controlling identity + can change the level. + +## Privacy considerations + +Prompts, answers and the history of a session are personal data of the person who wrote them, and +they may contain code and secrets. Their retention follows AEP-0009. Status shows no content. + +## Compliance note + +AWP provides machine-readable governance primitives that can help organizations implement and +enforce their own compliance requirements. This proposal makes no compliance promise. + +## Alternatives + +- **A session as a workflow with one step and `humanInput`.** Rejected: a step has a task and + ends; human input is information, not a decision; there is no autonomy level. +- **Confirmations as approvals (spec 7.6).** Rejected: approvals have approvers, quorum and + separation of duties, which do not fit dozens of confirmations per hour by the person who works + with the agent. Rules that require approvals still apply on top. +- **Autonomy only as platform configuration.** Rejected: the author knows best whether an agent + may run without a person; the platform can only lower the level. +- **Leave interactive use to runtimes.** Rejected: the reviewed manifest would say nothing about + the most common use of coding agents. + +## Implementation status + +A proof-of-concept Kubernetes runtime has its own session object with the fields of this AEP +under other names: modes `plan`, `ask` and `auto`; mode allowed by a binding instead of the +manifest; tool source selection; model alternatives per binding and tenant; pause on idle; one +execution id. A console lets people start sessions, confirm calls (once, for the session, refuse) +and switch modes. Confirmations are decided by a separate container in the sandbox pod, not by the +coding agent. Shown on a test installation: sessions with real models, modes, confirmations, tool +source selection, the self-approval attack and its counter-test. Not built: `confirm` per action +(the runtime asks for every allowed action in `ask`), the author's ceiling (`maxAutonomy`), and +sessions started by events. + +## Open questions + +1. Should `confirm` also exist for workflow runs, as "deny unless an approval step precedes"? +2. Is `readOnly` well-defined without a standard classification of actions into reading and + changing? Should AWP add a `readOnly` group? +3. What does a runtime keep after a session ends (history, workspace, diff), for how long, and who + may read it (runtime feedback G85)? Here, or in AEP-0009 and AEP-0025? +4. Should a session be startable by an event (runtime feedback G86), and is the attested actor of + AEP-0024 then its creator? +5. Name: `AgentSession` or `Session`? + +## Decision + +Not decided. Number to be confirmed by the maintainer. + +## References + +- Runtime feedback G62, G63, G73, G82, G85 ([runtime-feedback.md](../docs/runtime-feedback.md)). +- Spec `v1alpha3` sections 5.8, 6, 7.5, 7.6, 10.1, 10.4, 10.8. +- AEP-0005 (`Prompt`), AEP-0009 (audit payload levels), AEP-0017 (human input), AEP-0019 + (`WorkflowRun`), AEP-0023 (approval authority, ceilings), AEP-0027 (agent engine). diff --git a/aep/0027-agent-engine.md b/aep/0027-agent-engine.md new file mode 100644 index 0000000..5cbe276 --- /dev/null +++ b/aep/0027-agent-engine.md @@ -0,0 +1,250 @@ +# AEP-0027: Agent engine + +| | | +| --- | --- | +| **AEP** | 0027 | +| **Title** | Agent engine: running an agent with an existing coding agent | +| **Authors** | @agenticworkflowprotocol | +| **Shepherd** | to be assigned (not an author, [aep-process 5.1](../docs/aep-process.md#51-review-before-acceptance)) | +| **Type** | Specification | +| **Status** | Draft | +| **Reviewer roles needed** | runtime implementer (Kubernetes operator), runtime implementer (non-Kubernetes), security reviewer, coding agent maintainer | +| **Reviewers** | none yet | +| **Target API version** | `v1alpha3` | +| **Profiles affected** | `core`, `security`, new profile `engine` | +| **Created** | 2026-11-23 | +| **Discussion** | issue to be opened | +| **Supersedes** | - | +| **Superseded-by** | - | + +## Summary + +An `Agent` describes model, instructions, tools and permissions, and assumes the runtime runs the +tool loop. Coding agents bring their own loop with file editing, shell use, Git handling and +subagents, and runtimes would otherwise rebuild all of it. This AEP adds `agents[].engine`: which +engine runs the agent, from which workspace, and what it may push. It defines how AWP +permissions, budgets, outputs and audit apply to an engine. A runtime that does not have the +engine rejects the manifest instead of running a different loop. Configuration from the workspace +stays off unless the manifest allows it. The AEP answers runtime feedback G65, G66, G81 and G83. + +## Motivation + +- **Who runs the loop (G65).** A workflow step "fix the critical findings" is best run by a coding + agent. The manifest cannot say so: a proof-of-concept runtime used an extension field, and + another runtime ignoring it would run its own loop with different tools and still claim the + step succeeded. +- **Dead ends in a workflow (G66).** The engine of the proof of concept produces only a summary and + a diff. A step that declares outputs such as `critical` and `high` is rejected, so the next step + cannot branch on the number of findings. The repositories are fixed in the manifest, so an event + cannot name the repository to review. +- **Repository content as instructions (G81).** Repositories bring instruction files for agents, + skills, custom commands and tool manager configuration that sets environment variables. A coding + agent loads them by default. A pull request can then change what the agent does and run code at + start, before any permission applies. +- **Credentials of the workspace (G83).** Cloning a private repository needs a credential. If it + stays in the workspace or the environment, the engine and every command can read it. +- **Subagents.** An engine can start subagents. Whether they inherit permissions and budget, and + whether their requests belong to the execution, is undefined. + +## Goals and non-goals + +- Goals: name the engine; reject unknown engines; one mapping of AWP permissions to the engine; + budgets and audit as for any agent step; declared outputs filled by the engine; repositories as + inputs; workspace configuration off by default; credentials outside the engine. +- Non-goals: a list of engines; the engine's own options; interactive use (AEP-0026 uses the same + field); isolation (AEP-0023 `isolation`); state across executions (AEP-0025). + +## Specification + +### Changes to section 5.4 (agents) + +New field `engine` on inline agents and in `Agent` manifests: + +| Field | Type | Req. | Description | +| ----- | ---- | ---- | ----------- | +| `engine.type` | string | yes | The engine, a domain-prefixed value or a name from a registry this repository keeps (for example `opencode`). A runtime that does not support the type MUST reject the manifest. | +| `engine.runtimeProfile` | string | no | A runtime-defined profile for image and resources. It MUST NOT weaken `isolation` (AEP-0023). | +| `engine.workspace.repositories` | list | no | `url` (https, expression-enabled), `ref` (branch, tag or commit, expression-enabled), `path`. Cloned before the engine starts; the commit each one starts from is recorded as its base. | +| `engine.workspace.trustRepositoryConfig` | list | no | Kinds of workspace configuration the engine may load: `instructions` (agent instruction files), `skills`, `commands`, `toolchain` (tool manager configuration). Default: none. | +| `engine.push` | object | no | `branch` (expression-enabled) and `repository` (a `path` from `repositories`). | + +`engine` belongs to the `engine` profile. Expressions in `repositories` and `push` may use +`inputs.*`, `event.*` (AEP-0004) and `execution.*`. A resolved `url` is subject to the effective +network (AEP-0023) like any other destination. + +### New section 5.4.6 (engine semantics) + +- **Permissions.** The runtime maps the effective permissions (spec 7.5.4) to the engine. In + unattended executions an action is allowed or denied. There is nobody to ask, so `confirm: + always` (AEP-0026) is denied. Questions to a person are declined unless `humanInput` allows them + (spec 5.8.2). Access outside the workspace is denied. The engine's own permission system MAY + enforce the mapping in addition. Under `security`, a component outside the execution environment + MUST enforce it (AEP-0023 section 7.6.1). +- **Tools.** The tools that the engine offers to the model MUST be covered by the agent's tool + sources and permissions. Built-in tools of the engine map to action identifiers (`shell.execute`, + `file.write`, `web.fetch`), which the runtime documents per engine. +- **Failure.** A tool call that the runtime refuses because of a permission fails the step, + whatever the engine's exit code. So does an error that the engine reports, and a timeout. +- **Budgets.** Spec 5.7 applies to the engine's model calls. The runtime meters them outside the + engine, also during streaming (runtime feedback G78). Subagents of the engine share the step's + budget and permissions. Their calls belong to the step's execution and carry its execution id. +- **Outputs.** The engine produces the declared outputs of the step through the completion + mechanism of AEP-0018, with types and schemas from AEP-0003 where present. A runtime also + provides `summary` (the engine's final answer) and `diff` (changes against the base) if the step + declares them. A step that pushes MUST declare `branch` and `commit`, so that the execution + records what left the workspace. +- **Push.** `push` requires the action `git.push`, and pushes only to `branch` of `repository`. +- **Credentials.** Clone and push credentials are workflow secrets (spec 7.9). Under `security` they + MUST NOT be visible to the engine. The runtime clones and pushes outside the engine, or removes + the credential before the engine starts. Model and tool server credentials follow AEP-0023. +- **Workspace configuration.** Kinds not listed in `trustRepositoryConfig` MUST NOT be loaded by + the engine. Listed kinds are untrusted input (spec 12): they can change what the agent does, never + its permissions, budget or tools. +- **Audit.** Model calls and tool calls are audited as for any agent step. Events from the engine + itself carry the origin `engine` (runtime feedback G76). + +### Profile `engine` (spec 11) + +New profile with `engine` and section 5.4.6. The conformance statement lists the supported engine +types, the action mapping of their built-in tools, and which workspace configuration kinds they +can disable. + +## Examples + +A scan workflow whose repository comes from the event, with counts as typed outputs: + +```yaml +apiVersion: awp.agenticworkflowprotocol.org/v1alpha3 +kind: Workflow +metadata: + name: security-scan +spec: + version: 0.2.0 + owner: + team: appsec + classification: internal + triggers: + - type: event + eventType: com.example.security-scan.requested + agents: + - id: scanner + isolation: sandbox + engine: + type: opencode + workspace: + repositories: + - url: ${{ event.data.repository }} + ref: ${{ event.data.ref }} + path: repo + model: + provider: example-provider + name: example-model + tools: + - type: mcp + server: code-scanner + tools: [scan] + permissions: + default: deny + tools: + code-scanner.scan: {allow: true} + file.read: {allow: true} + workflow: + - id: scan + agent: scanner + task: Scan the repository, triage the findings and report them. Do not change files. + outputs: + - name: summary + - name: critical + type: integer + - name: high + type: integer + - id: escalate + if: ${{ steps.scan.outputs.critical > 0 }} + dependsOn: [scan] + agent: notifier + task: Open a ticket with ${{ steps.scan.outputs.summary }}. +``` + +The `if` condition needs AEP-0001 and the typed outputs need AEP-0003. Without them the example +shows where engine steps stop being dead ends. + +## Schema changes + +- `$defs/AgentEngine`; `engine` on `$defs/InlineAgent` and `$defs/AgentSpec`. +- Semantic rules: `engine.type-unsupported` (runtime), `engine.push-outputs-missing`, + `engine.repository-url-scheme`. + +## Conformance impact + +- New profile `engine`. Valid: `5.4-agent-engine.yaml`. Invalid: + `5.4-agent-engine-push-without-outputs.yaml`, `5.4-agent-engine-http-url.yaml`. +- Runtime tests: unknown engine rejected; a refused tool call fails the step; a subagent's model + call counts against the step budget; an instruction file in the repository is not loaded; the + clone credential is not readable from the engine. + +## Compatibility and migration + +Compatible: a new optional field. Runtimes with an extension field of the same shape migrate by +renaming. Until this AEP is applied, an `extensionRef` at the agent (AEP-0021 B3) is the conforming +way, and runtimes without the extension reject the manifest. + +## Security considerations + +- An engine is a large program with its own permission system, plugins and configuration loading. + It runs inside the execution environment, so its decisions do not count as enforcement under + `security` (AEP-0023 section 7.6.1). +- Workspace configuration is code and instructions from whoever can write to the repository. The + default "none" closes a path for prompt injection and code execution at start. +- `repositories` from event data allows a sender to choose what is cloned. The effective network and + the platform ceiling decide which hosts are reachable. Authors SHOULD restrict `url` with a + pattern in the event's `dataSchema`. + +## Privacy considerations + +Repositories may contain personal data. The diff is an output and follows the step's +classification. + +## Compliance note + +AWP provides machine-readable governance primitives that can help organizations implement and +enforce their own compliance requirements. This proposal makes no compliance promise. + +## Alternatives + +- **An extension field per runtime.** Works today with `extensionRef`, but every runtime names + engines differently, and reviewers cannot compare manifests. +- **Model engines as tools.** Rejected: the engine runs the whole loop and makes the model calls, + so budgets, model policy and audit must apply to it as to an agent. +- **Engine-specific outputs only (`summary`, `diff`).** Rejected: steps after an engine step need + typed outputs. + +## Implementation status + +A proof-of-concept Kubernetes runtime runs agent steps with OpenCode through an extension field of +this shape (with the repositories fixed and the outputs limited to `summary` and `diff`). The +runtime disables project configuration and external skills of the engine. A security scan +workflow ran with it on a test installation, started by hand and by a CloudEvent: the engine +called a static analysis server through the runtime's MCP gateway with a step ticket, and the +gateway counted the calls against the run's budget. Declared outputs other than `summary` and +`diff` are rejected today. Interactive sessions of the same runtime use the same engine +(AEP-0026). + +## Open questions + +1. Should this repository keep a registry of engine type names, or should every type be + domain-prefixed? +2. Must `tools` list exactly what the engine offers, or may an engine offer built-in tools that are + only covered by permissions? +3. Engine-specific options (variants, subagent definitions): `extensionRef` on `engine`, or out of + scope? +4. Is `trustRepositoryConfig` at the right level, or should it be a permission (`workspace.config`)? + +## Decision + +Not decided. Number to be confirmed by the maintainer. + +## References + +- Runtime feedback G65, G66, G81, G83, with G12 and G60 ([runtime-feedback.md](../docs/runtime-feedback.md)). +- Spec `v1alpha3` sections 5.4, 5.7, 5.8.2, 7.5, 7.9, 12. +- AEP-0001, AEP-0003, AEP-0004, AEP-0018, AEP-0021, AEP-0023, AEP-0026. diff --git a/spec/README.md b/spec/README.md index 3f4d1f6..c138ec8 100644 --- a/spec/README.md +++ b/spec/README.md @@ -44,9 +44,11 @@ and a Final Comment Period, and may still be moved to a later version or rejecte | [0020](../aep/0020-execution-pinning.md) | Pinning an execution to its manifests | Draft | proposed for `v1alpha3` | | [0021](../aep/0021-extension-model.md) | Extension model aligned with the Kubernetes Gateway API (concept) | Draft | proposed for `v1alpha3` | | [0022](../aep/0022-step-iteration.md) | Step iteration (`forEach`) | Accepted (lead decision D19) | in the `v1alpha2` draft | -| [0023](../aep/0023-step-isolation.md) | Step isolation: network permissions, platform ceilings and model credentials | Draft | proposed for `v1alpha3` | +| [0023](../aep/0023-step-isolation.md) | Step isolation: network permissions, platform ceilings, credentials, approval authority and isolation class | Draft | proposed for `v1alpha3` | | [0024](../aep/0024-event-triggers.md) | Event triggers with CloudEvents | Draft | proposed for `v1alpha3` | | [0025](../aep/0025-state.md) | State across executions | Draft | proposed for `v1alpha3` | +| [0026](../aep/0026-interactive-execution.md) | Interactive execution: `AgentSession`, autonomy levels and per-call confirmation | Draft | proposed for `v1alpha3` | +| [0027](../aep/0027-agent-engine.md) | Agent engine: running an agent with an existing coding agent | Draft | proposed for `v1alpha3` | The specification text is licensed under [CC BY 4.0](../LICENSE-SPEC); examples, schemas and code are licensed under [Apache-2.0](../LICENSE). From f0ec70910af2b4bfad6a416c6ffddbf4b107f794 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Mon, 23 Nov 2026 17:47:07 +0100 Subject: [PATCH 10/14] docs(aep): amendments from interactive sessions to AEP-0002, 0005, 0007, 0009, 0013, 0017 and 0021 Runtime feedback G70 to G78 and G84 pointed to existing AEPs. Each one now carries the proposed text and the evidence from the proof of concept: MCP prompts and resources as allow lists with default none and server requests answered by the runtime (AEP-0007, answers open question 3), the resource scope of shell commands (AEP-0002), prompts as tasks of interactive executions (AEP-0005), the origin of audit events and session history as content (AEP-0009), budgets during streaming (AEP-0013), agent requests in sessions (AEP-0017) and bindings for agents (AEP-0021). Signed-off-by: Simon Lauger --- CHANGELOG.md | 1 + aep/0002-tool-argument-constraints.md | 26 +++++++++++++++ aep/0005-prompt-kind.md | 26 +++++++++++++++ aep/0007-mcp-connection-catalog.md | 47 ++++++++++++++++++++++++--- aep/0009-audit-payload-levels.md | 30 +++++++++++++++++ aep/0013-runtime-clarifications.md | 11 +++++++ aep/0017-human-input.md | 12 +++++++ aep/0021-extension-model.md | 10 +++++- docs/runtime-feedback.md | 2 +- 9 files changed, 159 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60b058e..aa18365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ API versions (`v1alpha1`, ...) are versioned separately, see [GOVERNANCE.md](GOV - Runtime feedback: section 10 with G62 to G87 from interactive sessions and a coding agent engine, a proposal which platform objects become AWP kinds (extends K), and evidence for G50 and G60. - AEP-0023 (Draft): credentials of tool servers outside steps (G69), approval authority outside the execution environment (G64), a minimum isolation class on agents (G67), and one rule for platform ceilings: permissions, models, tool servers, autonomy and isolation reject, budgets cap (G68). Answers its open question 2. - New AEP drafts: AEP-0026 interactive execution (kind `AgentSession`, autonomy levels with an author ceiling, `confirm` per action, G62, G63, G73, G82) and AEP-0027 agent engine (`agents[].engine`, workspace configuration off by default, G65, G66, G81, G83). Numbers to be confirmed. +- Amendments from runtime feedback G70 to G78 and G84 to existing AEPs: AEP-0007 server prompts as allow list with default none (answers its open question 3), no resource without a catalog entry, server requests (sampling, roots, elicitation), resolution order, explicit tools for unattended executions; AEP-0002 resource scope of `shell.execute`; AEP-0005 prompts as tasks of interactive executions; AEP-0009 origin of events, tool arguments and session history as content; AEP-0013 budgets during streaming; AEP-0017 agent requests in sessions; AEP-0021 B6 bindings for `Agent`. - AEP-0024 and AEP-0025 (Draft): evidence from interactive sessions (runtime events, event-started sessions, workspaces across pause and resume, shared workspaces). - AEP-0021 B4: `triggers[].source` is no domain-prefixed value space; it is the CloudEvents `source` of the event producer (runtime feedback G54). - Spec `v1alpha3` section 12: content kept between executions (state) is untrusted input like tool results (runtime feedback G58). diff --git a/aep/0002-tool-argument-constraints.md b/aep/0002-tool-argument-constraints.md index 6fea7ee..87fd475 100644 --- a/aep/0002-tool-argument-constraints.md +++ b/aep/0002-tool-argument-constraints.md @@ -96,6 +96,26 @@ denied actions do not count. When the limit is reached, further matching actions with `reason: budget`. `maxCalls` is independent of `budget.resources.maxToolCalls`; both apply. +### New section 7.5.7: Resource scope of `shell.execute` (runtime feedback G74) + +A command line is not one target: it can chain commands (`;`, `&&`, `||`, `|`), substitute +commands (`$(...)`, backquotes), nest them in subshells or compound commands, and set variables +before a command. For `shell.execute` the resource of a call is defined as follows: + +1. The resources of a command line are its **simple commands**: the words of each command, without + quotes, joined by one space, with redirections removed. +2. `resources` entries are glob patterns: `*` matches any sequence, `?` one character, and a + trailing ` *` also matches the command without arguments. +3. The call is allowed only if **every** simple command of the line matches an entry. +4. A runtime MUST deny a line it cannot split into simple commands: command or process + substitution, subshells, compound commands (`if`, `for`, functions), leading variable + assignments, and expansions in the command name. +5. `resources` on a group or wildcard key applies to every action the key matches. A runtime that + cannot apply it to an action of the group MUST deny that action. +6. Informative: an allow list restricts which programs start, not what an allowed program does + (`make`, `npm test`, a test runner execute code from the repository). The isolation class and + the network rules of AEP-0023 are the boundary for that. + ### Changes to section 5.5.3 (wildcards): decision (confirmed by owner decision D4) The existing rule stays: a wildcard is only a final segment `*` (`github.*`). **Prefix wildcards @@ -198,6 +218,12 @@ enforce their own compliance requirements. This proposal makes no compliance pro At least one runtime in progress enforces argument constraints, an `allowAdditionalArgs` flag and per-tool call limits in its own format. No implementation of this AEP exists. +A proof-of-concept Kubernetes runtime implements section 7.5.7 for interactive sessions, decided by +a component outside the sandbox. Shown on a test installation with `resources: ["git *", "ls *", +"echo *"]`: `echo` and `git --version` ran; `curl ...`, `echo a; id` and `echo $(id)` were refused +with a reason the model sees. It accepts `resources` only on the exact key `shell.execute` and +rejects expressions in them. + ## Open questions 1. Should `deny` patterns stay, or move to `Policy` conditions only? diff --git a/aep/0005-prompt-kind.md b/aep/0005-prompt-kind.md index d80e814..9d9cf0e 100644 --- a/aep/0005-prompt-kind.md +++ b/aep/0005-prompt-kind.md @@ -75,6 +75,27 @@ Rendering rules: supplies the variables. `promptRef.version` stays an exact version; `digest` is verified like `ref.digest` (spec 5.4.2, 9.1). +### Prompts as tasks of interactive executions (runtime feedback G75) + +A `Prompt` with `role: user` MAY also serve as a reusable task of an interactive execution +(AEP-0026), for example a security review or a test-writing request that people start from a +library instead of typing it. Additional optional `spec` fields: + +| `spec` field | Type | Req. | Description | +| ------------ | ---- | ---- | ----------- | +| `title` | string | no | Short name shown to people. | +| `agents` | list | no | Names of `Agent` manifests the prompt fits. Absent: any agent. | +| `suggestedAutonomy` | string | no | `readOnly`, `ask` or `auto` (AEP-0026), shown as a suggestion. | + +Rules: + +- Such a prompt is plain user input: it runs with the permissions, budget and autonomy level of the + execution, can never extend them, and a suggested level is capped like any level the person + selects. +- Variables are filled by the person; for a free-text argument a prompt declares one `string` + variable (runtimes MAY map it to the argument convention of their engine). +- A server prompt of an MCP server (AEP-0007 rule 9) is not a `Prompt` manifest. + ### Reproducibility record (section 10.7) `agents[].prompt`: `name`, `version`, `digest` of the resolved `Prompt` manifest. @@ -167,6 +188,11 @@ enforce their own compliance requirements. This proposal makes no compliance pro No implementation of this AEP exists. +A proof-of-concept Kubernetes runtime has a namespaced prompt library object with title, prompt +text with one argument placeholder, the session templates it fits and a suggested mode; tenant +entries override platform entries of the same name, and sessions get them as commands of the +coding agent. It has no versions, digests or typed variables yet. + ## Open questions 1. Should a `Prompt` support several messages (system plus few-shot examples)? diff --git a/aep/0007-mcp-connection-catalog.md b/aep/0007-mcp-connection-catalog.md index 86d61f8..4d9be98 100644 --- a/aep/0007-mcp-connection-catalog.md +++ b/aep/0007-mcp-connection-catalog.md @@ -122,7 +122,8 @@ A catalog has these fields: | `matchServerInfo` | boolean | no | When `true`, a server whose `serverInfo` differs MUST NOT be used. Default `false`. | | `protocolVersion` | string | no | MCP protocol revision the catalog was reviewed against (for example `2026-07-28`). | | `tools` | map | yes | MCP tool `name` -> tool entry (below). | -| `resources` | list | no | Resource entries (below). | +| `resources` | list | no | Resource entries (below). Absent: no resource of the server is readable. | +| `prompts` | map | no | MCP prompt `name` -> prompt entry (below). Absent: no prompt of the server is offered. | | `profiles` | map | no | Profile name (`^[a-z][a-z0-9-]{0,62}$`) -> list of tool names of this catalog. | Tool entry: @@ -140,6 +141,10 @@ Resource entry: exactly one of `uri` or `uriTemplate` (RFC 6570, as in MCP resou plus `classification` (highest data class the content may have; the operation's data class is raised to it when the resource is read) and an optional `name`. +Prompt entry: `definitionDigest` (as for tools, over `name`, `title`, `description` and +`arguments` of the `prompts/list` entry; REQUIRED under `security`) and an optional +`classification` (highest data class of the arguments). + Rules: 1. Every profile member MUST be a tool of the catalog. A profile named `read` MUST contain only @@ -167,9 +172,32 @@ Rules: `reason: dataPolicy`) when the data classification of the operation ranks higher than the tool's `classification`. 7. Reading a resource (`resources/read`) is the action `.resources.read` with the resource - URI as its resource scope (spec 7.5.2); its access class is always `read`. When a catalog lists - `resources`, a URI that matches no entry MUST be denied. A catalog tool named `resources.read` + URI as its resource scope (spec 7.5.2); its access class is always `read`. A URI that matches no + entry of `resources` MUST be denied; without `resources`, every read is denied. The runtime + MUST filter `resources/list` and `resources/templates/list` to catalogued entries and MUST deny + `resources/subscribe` and completions for anything else. A catalog tool named `resources.read` is rejected (`catalog.reserved-name`). +9. **Prompts.** Getting a server prompt (`prompts/get`) is the action `.prompts.get` with + the prompt name as its resource scope. The runtime MUST filter `prompts/list` to catalogued + prompts and deny `prompts/get` for anything else. The content of a prompt is untrusted input + (spec 12): it is shown to the model or the person as user input, never as instructions with + more authority, and grants nothing. A server prompt and a `Prompt` manifest (AEP-0005) are + different things: the manifest is reviewed content of the workflow's owner, a server prompt is + content of the server's operator. +10. **Requests of the server.** The runtime MUST NOT relay sampling requests of a server to a model + unless the manifest allows it explicitly; an allowed sampling request is a model call under the + model policy (spec 7.4) and the budget. It MUST NOT answer roots requests with paths of the + execution environment unless allowed. Elicitation follows spec 5.8.2 (declined without + `humanInput`). A runtime SHOULD answer these requests itself rather than pass them to an engine + inside the execution environment. +11. **Resolution.** When the runtime resolves a server from its own configuration (spec 5.5.1), + the order is: the manifest's declaration, then the runtime binding, then the runtime's catalog. + A declaration and the resolved server MUST NOT contradict each other (transport, URL, catalog + digest); a runtime MUST reject the manifest instead of substituting a different server. A + platform ceiling (AEP-0023 section 7.5.7) MAY restrict which servers are usable. +12. **Unattended executions.** For executions without a person, a tool source SHOULD list its tools + explicitly; under `security`, `.*` grants only tools that are catalogued, so a tool the + server adds later is not exposed (rule 3). 8. A catalog is identified by its digest (AEP-0010 over the inline catalog object or the `McpCatalog` manifest). The reproducibility record (spec 10.7) lists, per MCP server, the catalog digest and the digests of the tool definitions that were exposed. @@ -321,13 +349,24 @@ Runtimes in progress keep connection-level tool access classes (read or write) i catalog and derive per-call approval and network placement from them; a manifest that is moved to another runtime loses this information. No implementation of this AEP exists. +A proof-of-concept Kubernetes runtime has a cluster-wide catalog object per MCP server with allow +lists for tools, prompts and resource URIs (prompts and resources default to none), resolved by +name in the order declaration, binding, catalog, and limited by a tenant ceiling. An MCP gateway +outside the execution environment filters the list operations, refuses everything else, answers +sampling, roots and elicitation requests itself, adds the server's credential and audits every +call with arguments and result. Shown on a test installation with a static analysis server: two +of its tools are not in the catalog and are neither listed nor callable; one prompt and the rule +resources are allowed (runtime feedback G69 to G72). No definition digests yet. + ## Open questions 1. Should built-in tools (`shell`) get catalog entries too? 2. Should `profiles` be renamed (for example `toolSets`) to avoid confusion with conformance profiles? MCP has no term for tool sets. 3. MCP prompts: should a catalog list server prompts, and how do they relate to the `Prompt` kind - (AEP-0005)? + (AEP-0005)? Proposed answer (runtime feedback G72): yes, as allow list with default none (rule + 9); a server prompt is untrusted content of the server's operator and is not a `Prompt` + manifest. 4. Should the definition digest include `icons` (display only) or members added by later MCP revisions? diff --git a/aep/0009-audit-payload-levels.md b/aep/0009-audit-payload-levels.md index 659ef30..0b6abfb 100644 --- a/aep/0009-audit-payload-levels.md +++ b/aep/0009-audit-payload-levels.md @@ -82,6 +82,29 @@ Rules: 4. Runtimes MAY enforce a lower maximum `contentRetention` or level by configuration and MUST then reject manifests that request more. +### Origin of events (runtime feedback G76) + +An agent's actions can be recorded in the execution environment (an engine or step runner, which +the agent can influence), in a user interface (which sees only what the engine reports) or in a +component outside the execution environment that holds the credentials (a model or tool gateway). + +5. Every event carries `origin`: `runtime` (produced outside the execution environment) or + `executionEnvironment` (produced inside it, for example by an engine). Under the `security` + profile, events about model calls, tool calls and approvals or confirmations MUST have origin + `runtime`. Events from inside MAY be recorded in addition and joined by identifiers (tool call + id); a runtime SHOULD flag disagreements between both. +6. A tool result reaches a gateway only as the agent reports it when the tool runs inside the + execution environment (a shell command). A runtime MUST document which events it cannot verify. + +### Content sent to tool sources and session history (runtime feedback G77, G85) + +7. Tool arguments can carry large amounts of workflow data (a scanner receives source code). At + `content`, they are content under rule 1 with `contentRetention`; at `metadata`, the event + records size and digest of the arguments, so that it stays verifiable what was sent where. +8. The history of an interactive execution (AEP-0026: prompts, answers, confirmations, model + output) is content. It follows `contentRetention` of the agent; read access to it is limited to + identities that could control the session and to auditors the runtime documents. + ## Examples ```yaml @@ -143,6 +166,13 @@ enforce their own compliance requirements. This proposal makes no compliance pro No implementation of this AEP exists. +A proof-of-concept Kubernetes runtime records conversations at its model gateway, append-only with +a hash chain per conversation, tool calls at its MCP gateway with arguments and result, and the +egress of the tenant proxy; events of the coding agent inside the sandbox are joined by tool call +id. Secret values are replaced by placeholders before the model and the audit log (the `redacted` +idea, shown on a test installation). It has no separate content storage, no salted digests and no +`contentRetention` yet. + ## Open questions 1. Should `redacted` be defined more precisely (which values count as non-sensitive)? diff --git a/aep/0013-runtime-clarifications.md b/aep/0013-runtime-clarifications.md index b96f277..ba7c633 100644 --- a/aep/0013-runtime-clarifications.md +++ b/aep/0013-runtime-clarifications.md @@ -62,6 +62,12 @@ Add after "The runtime MUST check limits before each model invocation and each a provider nor from a configured price, the runtime MUST NOT start the invocation (fail closed) and MUST fail the execution with `reason: budgetExceeded`, `limit: maxCostUsd` and `costKnown: false`. Counting unknown cost as zero is not allowed. +- **Streaming (runtime feedback G78).** When a provider reports usage only at the end of a + streamed invocation, the runtime MAY estimate usage while the stream runs and MAY end the stream + when the estimate reaches the remaining budget. It MUST then charge the best known usage (the + provider's figures if they arrive, otherwise the estimate) and MUST report that the figure is an + estimate. Budgets are hard limits that the last allowed invocation may exceed by what it consumed + before the runtime could stop it; the conformance statement says how usage is estimated. ### 2. Value rendering (section 3.9) @@ -216,6 +222,11 @@ must equal the bound connection). It differs in item 2 (missing values render as item 4 (own event format, no `workflow.*` events), and counts unknown cost as zero. No implementation of this AEP exists. +For streamed invocations, a proof-of-concept runtime estimates output tokens from the streamed text +(about four bytes per token) at its model gateway, ends the stream with an error event when the +estimate reaches the budget, and charges what it knows; a session can end slightly above +`maxCostUsd`. The overshoot is not measured. + ## Open questions 1. Item 1: should a runtime be allowed to reserve budget before an invocation instead of checking diff --git a/aep/0017-human-input.md b/aep/0017-human-input.md index f9ff790..5b068de 100644 --- a/aep/0017-human-input.md +++ b/aep/0017-human-input.md @@ -68,6 +68,13 @@ Applied in [spec/v1alpha3 section 5.8](../spec/v1alpha3/README.md#58-human-input messages and answers per `payload` (digest under `payload: metadata`). 8. **Profile**: new `interaction` profile, depending on `core`. Waiting counts against step `timeout` and `maxDuration`. +9. **Interactive executions (runtime feedback G84).** In an `AgentSession` (AEP-0026) agent + requests go to the identities that may control the session; `answerers` is not needed. The + request is answered in the session's user interface, audited with the same events, and the + session shows `waiting` while it is open. An answer stays information and is never a + confirmation of an action (AEP-0026) or an approval. Without a person (a paused session, an + unattended engine step) requests are declined. An engine's own question tool maps to agent + requests; questions it would ask outside this mechanism are declined. ## Examples @@ -169,6 +176,11 @@ enforce their own compliance requirements. This proposal makes no compliance pro Schema, CustomResourceDefinitions, semantic rules and conformance cases are in this repository. No runtime behaviour is implemented here. +A proof-of-concept Kubernetes runtime shows questions of a coding agent in interactive sessions as +cards with choices and free text and audits each answer; it rejects `humanInput` on session agents +because the session already has a person, and its MCP gateway declines elicitation requests of +servers. + ## Open questions 1. Should an input request support several answers (for example a vote) or only the first? diff --git a/aep/0021-extension-model.md b/aep/0021-extension-model.md index 0ddd84f..bd1f5f0 100644 --- a/aep/0021-extension-model.md +++ b/aep/0021-extension-model.md @@ -271,7 +271,11 @@ spec: ``` - **Implementation-specific.** Binding kinds belong to the runtime (vendor group, own CRD). AWP - defines only `targetRefs`, the status and the rules below. Bindings carry the discovery label + defines only `targetRefs`, the status and the rules below. +- **Targets.** A binding targets a `Workflow` or an `Agent`. An `Agent` binding configures how the + runtime runs that agent on its own, for example as an interactive session (AEP-0026): image or + runtime profile, model alternatives, secret mapping. For an agent used inside a workflow, the + workflow's binding applies. Bindings carry the discovery label `awp.agenticworkflowprotocol.org/binding: "true"`; the target gets a condition `Bound`. - **One accepted binding per workflow and runtime.** Several bindings of one runtime on the same workflow would start it twice. The runtime accepts the oldest binding (creation time, then name) @@ -393,6 +397,10 @@ enforce their own compliance requirements. This proposal makes no compliance pro Concept only. A Kubernetes runtime proof of concept already uses a binding object that points at the workflow (B6) and no extension fields; its review of this draft is reflected in B6 and B9. +Its platform extension adds an agent binding for interactive sessions and keeps tenants and +sandbox profiles as implementation-specific objects; its one extension field (the engine of an +agent) is the kind of field that B3 turns into an `extensionRef` until AEP-0027 is applied. Which +of its objects should become AWP kinds is discussed in runtime feedback section 10. ## Open questions diff --git a/docs/runtime-feedback.md b/docs/runtime-feedback.md index 66a9ad6..68ce7c5 100644 --- a/docs/runtime-feedback.md +++ b/docs/runtime-feedback.md @@ -39,7 +39,7 @@ portable runtimes, **should** needs a rule, **minor** is editorial or informativ | AEP drafted and applied to the `v1alpha3` draft (Draft, not accepted) | G01, G07, G08, G40; partly G14, G15 | | AEP drafted, not applied | G10, G47, G49, G50, G51, G61, G64, G67 to G69 (AEP-0023); G42 to G46, G54, G56, G86 (AEP-0024); G03, G53, G58, G87 (AEP-0025) | | New AEP proposed (number to be confirmed) | G62, G63, G73, G82, G85 (AEP-0026, interactive execution); G65, G66, G81, G83 (AEP-0027, agent engine) | -| Fits an existing AEP that is not applied yet (from section 10) | G70 to G72 (AEP-0007); G74 (AEP-0002); G75 (AEP-0005); G76 (AEP-0009); G78 (AEP-0013); G84 (AEP-0017) | +| Amendment drafted in an existing AEP that is not applied yet (from section 10) | G70 to G72 (AEP-0007); G74 (AEP-0002); G75 (AEP-0005); G76, G85 in part, G77 in part (AEP-0009); G78 (AEP-0013); G84 (AEP-0017) | | Covered by an existing AEP that is not applied yet | G02, G04, G06, G22; G41 (AEP-0004); G48, G57 (AEP-0019 open question 1); G52 (AEP-0021); G55 (AEP-0012); G59, G60 (AEP-0008) | | Open, needs a decision whether and how | G05, G09, G11, G12, G13, G16 to G21, G24 to G39, G77, G79, G80, K | From ef4649ac3f0231fb82eeef1250dbf5189070626a Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Mon, 23 Nov 2026 19:21:25 +0100 Subject: [PATCH 11/14] docs(aep): AEP-0023 structured destinations, normalised addresses, ceilings reject Review of pull request 23: a port appended to an IPv6 address is ambiguous, so allowHosts becomes allowTo with objects as in network policies (host or cidr, except, ports with port, endPort, protocol). IPv4-mapped and IPv4-compatible addresses are normalised before every check, and NAT64 and 6to4 are denied as internal destinations. A platform ceiling never adjusts a manifest: anything above it is rejected, and under a budget ceiling the limit must be declared. Signed-off-by: Simon Lauger --- CHANGELOG.md | 2 +- aep/0023-step-isolation.md | 184 ++++++++++++++++++++++++------------- docs/runtime-feedback.md | 4 +- 3 files changed, 122 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa18365..3be2e22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ API versions (`v1alpha1`, ...) are versioned separately, see [GOVERNANCE.md](GOV ### Changed - Runtime feedback: section 10 with G62 to G87 from interactive sessions and a coding agent engine, a proposal which platform objects become AWP kinds (extends K), and evidence for G50 and G60. -- AEP-0023 (Draft): credentials of tool servers outside steps (G69), approval authority outside the execution environment (G64), a minimum isolation class on agents (G67), and one rule for platform ceilings: permissions, models, tool servers, autonomy and isolation reject, budgets cap (G68). Answers its open question 2. +- AEP-0023 (Draft): credentials of tool servers outside steps (G69), approval authority outside the execution environment (G64), a minimum isolation class on agents (G67), and one rule for platform ceilings: anything above a ceiling is rejected, nothing is adjusted (G68); `allowHosts` replaced by structured `allowTo` (`host` or `cidr`, `except`, `ports`, aligned with network policies); IPv4-embedding IPv6 addresses normalised and NAT64 and 6to4 denied as internal destinations. Answers its open question 2. - New AEP drafts: AEP-0026 interactive execution (kind `AgentSession`, autonomy levels with an author ceiling, `confirm` per action, G62, G63, G73, G82) and AEP-0027 agent engine (`agents[].engine`, workspace configuration off by default, G65, G66, G81, G83). Numbers to be confirmed. - Amendments from runtime feedback G70 to G78 and G84 to existing AEPs: AEP-0007 server prompts as allow list with default none (answers its open question 3), no resource without a catalog entry, server requests (sampling, roots, elicitation), resolution order, explicit tools for unattended executions; AEP-0002 resource scope of `shell.execute`; AEP-0005 prompts as tasks of interactive executions; AEP-0009 origin of events, tool arguments and session history as content; AEP-0013 budgets during streaming; AEP-0017 agent requests in sessions; AEP-0021 B6 bindings for `Agent`. - AEP-0024 and AEP-0025 (Draft): evidence from interactive sessions (runtime events, event-started sessions, workspaces across pause and resume, shared workspaces). diff --git a/aep/0023-step-isolation.md b/aep/0023-step-isolation.md index 7fdf14d..4eb1d81 100644 --- a/aep/0023-step-isolation.md +++ b/aep/0023-step-isolation.md @@ -22,13 +22,13 @@ `permissions.network` says what a workflow or agent needs, but not how host names are written, how the rule relates to limits that the platform sets (network policies, egress proxies, firewalls), what happens when a runtime cannot enforce it, or which addresses an allowed host may -resolve to. Model credentials are not covered at all. This AEP defines the host syntax, makes the +resolve to. Model credentials are not covered at all. This AEP replaces `allowHosts` with structured destinations (`allowTo`: `host` or `cidr`, `except`, `ports`, aligned with network policies), makes the effective network the intersection of the manifest and a platform ceiling, requires a runtime to -enforce or reject, denies private and internal destinations after resolution by default under the +enforce or reject, denies private and internal destinations after resolution and normalisation by default under the `security` profile unless both the manifest and the ceiling allow them, defaults `egress` to `deny` under that profile, and keeps model credentials out of steps. It extends the same rule to the credentials of tool servers and to the authority that approves actions, lets a manifest require a -minimum isolation class, and states which ceilings reject and which cap. It answers runtime +minimum isolation class, and states that ceilings reject and never adjust a manifest. It answers runtime feedback G10, G47, G49, G50, G51, G61, G64, G67, G68 and G69. All additions follow one principle: **what decides about a step, or what a step must not be able @@ -75,16 +75,19 @@ credentials and approvals are the three cases a proof of concept met in practice - **Isolation is invisible.** A step that runs commands on an untrusted repository needs more than a container (a user-space kernel or a virtual machine). The manifest cannot require it; the choice sits in a runtime binding that reviewers do not see (G67). -- **Reject or cap.** The proof of concept has ceilings per tenant for models, hosts, tool servers, - autonomy and cost. A model outside the ceiling makes the agent invalid, while a cost limit above - the ceiling is lowered to it. The specification says neither (G68). +- **Reject or adjust.** The proof of concept has ceilings per tenant for models, hosts, tool + servers, autonomy and cost. A model outside the ceiling makes the agent invalid, while a cost + limit above the ceiling is lowered to it, so the run differs from the reviewed manifest. The + specification says neither (G68). +- **Ports and IPv6.** A port appended to an address string is ambiguous for IPv6 + (`2001:db8::1:443`), and the egress rules of network policies keep addresses and ports apart. ## Goals and non-goals -- Goals: one host syntax; a defined relation between manifest and platform ceiling; enforce or +- Goals: one structured destination format; a defined relation between manifest and platform ceiling; enforce or reject; safe defaults under `security`; internal destinations possible when explicitly allowed; model and tool server credentials outside steps; approvals decided outside steps; a - minimum isolation class that reviewers can see; one rule for ceilings. + minimum isolation class that reviewers can see; one rule for ceilings (reject). - Non-goals: a mechanism (proxy, mesh, policy engine, sandbox technology); per-port or per-protocol firewall rules; inbound traffic; secret stores (spec 7.9 stays as it is); the interactive execution form itself (AEP-0026); what data a step may send to a tool server @@ -97,24 +100,34 @@ credentials and approvals are the three cases a proof of concept met in practice | Field | Type | Description | | ----- | ---- | ----------- | | `network.egress` | string | `allow` or `deny`: outbound network access of command steps and built-in tools. Default `allow`; under the `security` profile the default is `deny`. | -| `network.allowHosts` | list | Destinations reachable when `egress` is `deny`, in the syntax of section 7.5.5. | +| `network.allowTo` | list | Destinations reachable when `egress` is `deny`, as objects of section 7.5.5. Replaces `allowHosts`. | ### New section 7.5.5 (network destinations) -An entry of `allowHosts` is one of: +An entry of `allowTo` is an object. Its fields follow the egress rules of a Kubernetes +`NetworkPolicy` (`ipBlock.cidr`, `ipBlock.except`, `ports`), without the nesting, so that a rule +can be translated field by field: -| Form | Example | Matches | -| ---- | ------- | ------- | -| Host name | `api.example.com` | exactly this name (case-insensitive, without trailing dot) | -| Subdomain wildcard | `*.example.com` | any name with at least one label before `example.com`, not `example.com` itself | -| Address | `10.20.0.15`, `2001:db8::1` | exactly this address | -| CIDR | `10.20.0.0/16` | any address in the range | +| Field | Type | Req. | Description | +| ----- | ---- | ---- | ----------- | +| `host` | string | cond. | A host name (`api.example.com`, matched case-insensitive, without trailing dot) or a subdomain wildcard (`*.example.com`: any name with at least one label before `example.com`, not `example.com` itself). Exactly one of `host` and `cidr`. | +| `cidr` | string | cond. | An IPv4 or IPv6 range in CIDR notation (`10.20.0.0/16`, `2001:db8::/32`). A single address is written with a full prefix (`10.20.0.15/32`, `2001:db8::1/128`). Exactly one of `host` and `cidr`. | +| `except` | list | no | CIDR ranges inside `cidr` that are excluded. Only with `cidr`. | +| `ports` | list | no | Allowed ports. Absent: every port. Each entry has `port` (integer 1 to 65535, REQUIRED), `endPort` (integer, optional, at least `port`: a range) and `protocol` (`TCP` (default) or `UDP`). | -Each form MAY end with `:`; without a port, every port matches. A `*` anywhere other than as -the first label is invalid, and so is a bare `*`. Validators MUST reject invalid entries. +Rules: -Host name entries are matched against the name the step requested, before resolution. Address and -CIDR entries are matched against the resolved address. +- Entries are objects only; a string entry is invalid. A `*` anywhere other than as the whole + first label of `host` is invalid, and so is a bare `*`. `host` MUST NOT contain a port, an + address or a CIDR. Validators MUST reject invalid entries. +- `host` entries are matched against the name the step requested, before resolution. `cidr` + entries are matched against the resolved address, after normalisation (7.5.6). +- A connection is allowed if one entry matches its destination and, when the entry has `ports`, + its port and protocol. + +Informative mapping: a `cidr` entry becomes an `ipBlock` with `except` and `ports` in a +`NetworkPolicy`; a `host` entry needs a mechanism that matches names, for example the FQDN rules +of a network plugin (`toFQDNs` with `toPorts`) or the allow list of an egress proxy. ### New section 7.5.6 (enforcement and platform ceilings) @@ -128,20 +141,27 @@ CIDR entries are matched against the resolved address. requires, the runtime MUST reject the manifest or the execution before any step runs, with a reason that names the rule and the step type. It MUST NOT run the step with weaker restrictions. -- **Internal destinations (security profile).** After resolution, the runtime MUST deny - connections to loopback (`127.0.0.0/8`, `::1`), private (`10.0.0.0/8`, `172.16.0.0/12`, - `192.168.0.0/16`, `fc00::/7`), link-local (`169.254.0.0/16`, `fe80::/10`), CGNAT - (`100.64.0.0/10`) and unspecified addresses by default. Such a destination is allowed only if - **both** hold: the manifest allows it explicitly (an address or CIDR entry that contains the - resolved address, or a host name entry for the name that resolved to it), and the platform - ceiling allows the resolved address. This is no blanket ban: agents may use internal services +- **Normalisation.** Before any check against `cidr` entries, the internal ranges below or the + ceiling, the runtime MUST normalise an IPv6 address that embeds an IPv4 address in a fixed way + to that IPv4 address: IPv4-mapped (`::ffff:0:0/96`) and IPv4-compatible (`::/96`, except `::` + and `::1`). Otherwise `::ffff:169.254.169.254` would reach the metadata address while passing a + check against `169.254.0.0/16`. +- **Internal destinations (security profile).** After resolution and normalisation, the runtime + MUST deny connections to loopback (`127.0.0.0/8`, `::1`), private (`10.0.0.0/8`, + `172.16.0.0/12`, `192.168.0.0/16`, `fc00::/7`), link-local (`169.254.0.0/16`, `fe80::/10`), + CGNAT (`100.64.0.0/10`), unspecified addresses, and the IPv6 translation ranges NAT64 + (`64:ff9b::/96`, `64:ff9b:1::/48`) and 6to4 (`2002::/16`) by default. Translation ranges are + denied rather than normalised because whether a translator sits behind them depends on the + network. Such a destination is allowed only if **both** hold: the manifest allows it + explicitly (a `cidr` entry that contains the normalised address, or a `host` entry for the name + that resolved to it), and the platform ceiling allows the normalised address. This is no blanket ban: agents may use internal services when author and operator both say so. The check MUST apply to the address actually connected to, including after redirects, so that a DNS change between check and connection cannot reach an address that the ceiling does not allow. - **Conformance statement.** A runtime MUST state per step type how it enforces network access and which ceiling sources it reads (spec 11). -Informative: a per-workload egress proxy with an allowlist derived from `allowHosts`, plus a +Informative: a per-workload egress proxy with an allowlist derived from `allowTo`, plus a network policy that lets the workload reach only that proxy, is one conforming enforcement for command steps. A built-in tool can enforce in-process with a connection-time address check. @@ -168,7 +188,7 @@ command steps. A built-in tool can enforce in-process with a connection-time add (which tools are listed and which calls are allowed), because a step that talks to the server directly is not bound by anything else. - Traffic from the step to such a component is runtime-internal and does not need an - `allowHosts` entry. The tool server's own outbound traffic is not part of the step's + `allowTo` entry. The tool server's own outbound traffic is not part of the step's `permissions.network`; a runtime SHOULD restrict it as well and say how in its conformance statement. @@ -204,25 +224,33 @@ under the same user ID as the step's commands is not. - The values are ordered (`process` < `container` < `sandbox` < `vm`). A runtime MUST run the step with at least the required class or reject the manifest or execution before any step runs. +- `isolation` is a minimum: a step that runs with a stronger class meets it. A platform MAY require + a minimum class for every workload (for example `sandbox` per tenant); running an agent that + requires `container` in a sandbox is no conflict. - Which mechanism provides a class (for example gVisor for `sandbox`, Kata Containers or - Firecracker for `vm`) is platform configuration. A platform MAY also require a minimum class - through its ceiling; the stricter one applies. + Firecracker for `vm`) is platform configuration. - The conformance statement lists which classes the runtime provides and by which mechanism. ### New section 7.5.7 (platform ceilings in general) -7.5.6 defines the network ceiling. The same rules apply to every ceiling that a platform sets: - -- **Permissions, models, tool servers, autonomy and isolation**: the effective value is the - intersection of the manifest and the ceiling. If the manifest requires something that the - ceiling does not allow (a model, a host, a tool server, an autonomy level, an isolation class - below the platform minimum), the runtime MUST reject the manifest or execution before any step - runs, with a reason that names the rule. -- **Budgets**: a ceiling caps the manifest's limits. The effective limit is the lower one, and a - manifest without a limit gets the ceiling. A runtime MUST NOT reject a manifest only because its - budget is higher than the ceiling. -- A runtime SHOULD report the effect of a ceiling where the author can see it (status condition, - validation result). +7.5.6 defines the network ceiling. The same rule applies to every ceiling that a platform sets +(permissions, models, tool servers, network, autonomy, isolation, budgets): **a ceiling never +changes a manifest silently, it rejects.** + +- If the manifest or a request asks for more than the ceiling allows, the runtime MUST reject the + manifest, the execution or the request before anything runs, with a reason that names the rule + (`ceilingExceeded`, with the field). Examples: a model or tool server outside the ceiling; a + destination the ceiling does not allow; an isolation class the platform cannot provide; an + autonomy level above the ceiling (AEP-0026); a `maxCostUsd` or token limit above the ceiling. +- If the ceiling sets a budget limit, the manifest MUST declare that limit (at a value up to the + ceiling); a manifest without it is rejected. A runtime MUST NOT fill in or lower a limit on its + own. +- A stronger isolation class than required is no deviation (5.4). +- A runtime SHOULD make ceilings visible to authors before they apply a manifest (for example in + the status of a binding or a validation command). + +Rejecting instead of adjusting keeps the reviewed manifest the truth: an execution never runs with +a budget, a model or an autonomy level that differs from what the reviewer saw. ### Change to the profile table (spec 11) @@ -245,10 +273,20 @@ spec: permissions: network: egress: deny - allowHosts: - - api.example.com - - "*.cdn.example.com:443" - - 10.20.0.0/16 # internal ticket system, explicitly allowed + allowTo: + - host: api.example.com + ports: + - port: 443 + - host: "*.cdn.example.com" + - cidr: 10.20.0.0/16 # internal ticket system, explicitly allowed + except: + - 10.20.99.0/24 + ports: + - port: 8000 + endPort: 8080 + - cidr: 2001:db8::1/128 + ports: + - port: 443 agents: - id: triage model: @@ -276,9 +314,11 @@ runtime holds: tools: [scan] permissions: default: deny - allow: - code-scanner.scan: true - shell.execute: true + tools: + code-scanner.scan: + allow: true + shell.execute: + allow: true ``` A runtime that offers only containers rejects this agent. The step reaches `code-scanner` through @@ -292,21 +332,28 @@ is denied. ## Schema changes -- `allowHosts` items: a pattern for the four forms with optional port. -- Semantic rule `permissions.network.host-invalid` for wildcards outside the first label, bare - `*` and invalid CIDRs. +- `permissions.network.allowTo`: list of objects with `host` or `cidr` (`oneOf`), `except` + (only with `cidr`), `ports` (`port`, `endPort`, `protocol`). `allowHosts` is removed; + `awp-check.mjs migrate` converts `name` to `{host: name}`, an address to `{cidr: address/32}` or + `/128`, and a CIDR to `{cidr: ...}`. +- Semantic rules: `permissions.network.host-invalid` (wildcards outside the first label, bare `*`, + a port or address in `host`), `permissions.network.cidr-invalid`, `except-outside-cidr`, + `port-range-invalid` (`endPort` below `port`). - `agents[].isolation`: enum `process`, `container`, `sandbox`, `vm`. ## Conformance impact -- `core`: host syntax, enforce-or-reject, conformance statement. +- `core`: `allowTo`, enforce-or-reject, conformance statement. - `security`: default `egress: deny`, internal destinations, model and tool server credentials, approval authority, isolation class. - Valid: `5.4-agent-isolation.yaml`. Invalid: `5.4-agent-isolation-unknown.yaml`. -- Valid: `7.5.5-allow-hosts-forms.yaml`. Invalid: `7.5.5-allow-hosts-bare-wildcard.yaml`, - `7.5.5-allow-hosts-inner-wildcard.yaml`, `7.5.5-allow-hosts-invalid-cidr.yaml`. +- Valid: `7.5.5-allow-to-forms.yaml`. Invalid: `7.5.5-allow-to-string-entry.yaml`, + `7.5.5-allow-to-bare-wildcard.yaml`, `7.5.5-allow-to-host-with-port.yaml`, + `7.5.5-allow-to-host-and-cidr.yaml`, `7.5.5-allow-to-except-outside.yaml`, + `7.5.5-allow-to-port-range.yaml`. - Runtime tests (once a runtime suite exists): a host that resolves to a private address; a - redirect to `169.254.169.254`; a DNS answer that changes between two lookups; a ceiling that + redirect to `169.254.169.254`; a AAAA record `::ffff:169.254.169.254`; an address in + `64:ff9b::/96`; a DNS answer that changes between two lookups; a ceiling that forbids a required host (rejected before start); a process in the step that tries to read a tool server credential; a process in the step that answers its own confirmation request; an agent that requires `vm` on a runtime with containers only (rejected before start). @@ -316,8 +363,13 @@ is denied. - Manifests with host names only stay valid. Entries that were tolerated before and are invalid now (bare `*`) become invalid. - Under `security`, manifests without `network` change from "egress allowed" to "egress denied"; - authors add `egress: allow` or `allowHosts`. -- Runtimes that ignored `allowHosts` for command steps must enforce or reject. + authors add `egress: allow` or `allowTo`. +- `allowHosts` becomes `allowTo` with objects (incompatible, allowed in an alpha version); + `awp-check.mjs migrate` converts it. Entries with a port in the string have no automatic + conversion for IPv6 and are reported. +- Under a budget ceiling, manifests without that budget limit and manifests with a higher limit + become invalid for that platform. +- Runtimes that ignored network rules for command steps must enforce or reject. - Under `security`, runtimes that pass `auth` of MCP servers into steps must move it to a gateway or the runtime. Manifests stay valid; `auth.secretRef` becomes optional where the runtime provides the credential. @@ -379,10 +431,12 @@ and no measurement of proxy latency or cost. The same runtime, extended to interactive sessions with a coding agent, shows the additions: - **Ceilings and egress.** An egress proxy per tenant with an allow list derived from the tenant - ceiling and the agent's `allowHosts`. It denies private, loopback, link-local and CGNAT + ceiling and the agent's host list. It denies private, loopback, link-local and CGNAT destinations after resolution, and a network policy lets the sandbox reach only that proxy and - the gateways. Models, hosts and tool servers outside the tenant ceiling reject the agent; cost - limits are capped. + the gateways. Models, hosts and tool servers outside the tenant ceiling reject the agent. It + differs from this AEP in two points: cost limits above the tenant ceiling are capped instead of + rejected, and its allow list has host names without ports. Normalisation of IPv4-mapped + addresses and the translation ranges are not tested. - **Tool server credentials.** A static analysis server over MCP is reachable only through the runtime's MCP gateway (network policy). The gateway accepts a session ticket or a step ticket, hides tools that are not in the catalog, refuses calls to them, counts calls against the budget @@ -397,9 +451,9 @@ The same runtime, extended to interactive sessions with a coding agent, shows th ## Open questions -1. Should the ceiling be visible to authors, for example in the status of a binding or workflow - (`Accepted` with reason `NetworkCeiling`)? The proof of concept reports it in the status of the - binding. +1. How are ceilings made visible to authors before they apply a manifest, given that they reject + (status of a binding, a validation command, a published ceiling object)? The proof of concept + reports them in the status of its binding. 2. Do MCP servers over `streamable-http` fall under the same rules as built-in tools? Proposed answer from the proof of concept: the step's connection to the server goes through a component outside the step (5.5.1) and is runtime-internal; the server's own egress is restricted by the diff --git a/docs/runtime-feedback.md b/docs/runtime-feedback.md index 68ce7c5..1ce13af 100644 --- a/docs/runtime-feedback.md +++ b/docs/runtime-feedback.md @@ -172,7 +172,7 @@ change would fit. | ID | Sev. | Gap | Proposal from the runtime | Home | Status | | --- | --- | --- | --- | --- | --- | | G48 | must | Event runs created by an external router (an event router creating run objects) fit neither role of spec 10.8: client-created runs are manual, runtime-created runs record the trigger only in status, and the run spec has no trigger. | A trusted-ingress role: an authenticated identity the runtime accepts may create runs with trigger type `event` and an event payload; the runtime checks the trigger against the manifest, records the ingress identity and rejects event fields from other creators. | AEP-0019 open question 1 | open; the runtime now plans to create event runs itself from a generated trigger object, which needs no new role; the role stays relevant for external routers | -| G49 | should | `permissions.network.allowHosts` has no syntax: subdomain wildcards, ports, IP literals and CIDRs are undefined. | Define host matching (exact, `*.domain`), optional ports, and whether addresses or CIDRs are allowed. | [AEP-0023](../aep/0023-step-isolation.md) | AEP drafted | +| G49 | should | `permissions.network.allowHosts` has no syntax: subdomain wildcards, ports, IP literals and CIDRs are undefined. | Define host matching (exact, `*.domain`), optional ports, and whether addresses or CIDRs are allowed. | [AEP-0023](../aep/0023-step-isolation.md) | AEP drafted; revised after review on 2026-11-23: `allowHosts` becomes `allowTo` with objects (`host` or `cidr`, `except`, `ports`) as in network policies, because a port appended to an IPv6 address is ambiguous | | G50 | must | An allowed host can resolve to loopback, private, link-local (cloud metadata) or CGNAT addresses (SSRF, DNS rebinding); the proof of concept had this hole. | Under the security profile, deny such destinations after resolution unless listed explicitly as addresses. | [AEP-0023](../aep/0023-step-isolation.md) | AEP drafted; the proof of concept now checks the resolved address at connection time (covers rebinding and redirects by construction), without an explicit rebinding test. Second enforcement point: the egress proxy of every tenant and of a tool server deny private, loopback, link-local and CGNAT destinations after resolution, and the network policy of the proxy excludes them as well | | G51 | should | No guidance on how `permissions.network` is enforced for command steps. | Informative: a per-workload egress proxy with an allowlist derived from `allowHosts`, plus a network policy that allows only that proxy, is conforming. A runtime that cannot enforce a network rule rejects the workflow. | [AEP-0023](../aep/0023-step-isolation.md), with G10 | AEP drafted | | G52 | should | AEP-0021 B6 covers bindings but not runtime trigger objects (routing, expression filters, rate limits). | Trigger objects attach with `targetRefs` and `sectionName` (trigger index), may only narrow the manifest trigger, are generated from or validated against `spec.triggers`, and report `Accepted`. | AEP-0021 (extend B6) | open | @@ -217,7 +217,7 @@ failed only after the decision moved to a separate container. | G65 | must | Engine of an agent. A coding agent brings its own tool loop, file editing and shell use. No field says which engine runs an agent, what it receives and produces, how permissions map to it, or whether its subagents inherit permissions and budget. The runtime uses an extension field. | `agents[].engine` (`type`, `runtimeProfile`, `repositories`, `push`). Allow or deny only when unattended. A refused call fails the step. Subagents inherit permissions and budget. Unknown engines are rejected. | new AEP: [AEP-0027](../aep/0027-agent-engine.md); until then `extensionRef` ([AEP-0021](../aep/0021-extension-model.md) B3) | shown: a workflow ran its review step with the engine, started by hand and by an event | | G66 | should | Engine steps produce only a summary and a diff. A step that declares outputs such as `critical` and `high` is rejected, and its repositories are fixed, so an event cannot pass one. | The engine fills declared outputs through the completion tool of AEP-0018 with the schema of AEP-0003. `repositories` is expression-enabled with `inputs.*` and `event.*`. | AEP-0027 | shown (the rejection) | | G67 | should | Agents that run untrusted code need stronger isolation than a container. The manifest cannot require it: the runtime class sits in the binding, invisible to reviewers. | A minimum `agents[].isolation` (`container`, `sandbox`, `vm`) that a runtime meets or rejects. The mechanism is platform configuration. | AEP-0023 | mapping implemented; no class above `container` deployed | -| G68 | should | Ceilings. AEP-0023 defines a network ceiling, but not whether ceilings reject or cap. The runtime rejects models, hosts and MCP servers outside its tenant ceiling and caps cost. Tenants also limit tool sources, autonomy and concurrent sessions. | Ceilings on permissions, models, tool sources, autonomy and isolation reject. Budget ceilings cap the manifest's limits. Rejection is visible in status. | AEP-0023 | shown | +| G68 | should | Ceilings. AEP-0023 defines a network ceiling, but not whether ceilings reject or cap. The runtime rejects models, hosts and MCP servers outside its tenant ceiling and caps cost. Tenants also limit tool sources, autonomy and concurrent sessions. | A ceiling never adjusts a manifest: anything above it (model, tool source, destination, autonomy, isolation the platform cannot provide, budget) is rejected, and under a budget ceiling the manifest must declare the limit. Revised after review on 2026-11-23 (the first draft capped budgets). | AEP-0023 | shown | | G69 | should | MCP credentials. Spec 5.5.1 `auth.secretRef` hands the credential to the MCP client. When the client is a coding agent in a sandbox, the agent and every command can read it. | Under the `security` profile, tool server credentials stay outside the execution environment, like model credentials (G61). A gateway authenticates the execution with a short-lived ticket, and `auth` may be satisfied by the runtime. | AEP-0023 | shown: the static analysis server is reachable only through the gateway, with a session ticket and a step ticket | | G70 | should | Resolution of MCP servers from runtime configuration (5.5.1). The order, partial declarations and substitution are undefined. | Resolve declaration first, then binding, then catalog. A declaration and the resolved server must not contradict each other. | [AEP-0007](../aep/0007-mcp-connection-catalog.md) | implemented, integration tests | | G71 | should | `server.*` also allows tools that a server adds after the review, and unattended steps run them unseen. | An explicit tools list for unattended executions. Tool annotations are untrusted unless the platform pins the server. | AEP-0007 | shown: the catalog hides two tools of the server, and calls to them are refused | From c73b6873273dcc60060f481f41059ad85fe300d5 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Mon, 23 Nov 2026 19:21:25 +0100 Subject: [PATCH 12/14] docs(aep): AEP-0026 confirm always per call, autonomy rejected above ceiling, agent governance Review of pull request 23: actions with confirm: always accept only allowOnce, a level above maxAutonomy or the ceiling is rejected instead of capped, and an Agent can declare dataPolicy, modelPolicy, environments, policies and audit for executions without a workflow; under security an agent with sessions needs audit with contentRetention. Signed-off-by: Simon Lauger --- aep/0026-interactive-execution.md | 76 +++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/aep/0026-interactive-execution.md b/aep/0026-interactive-execution.md index b542029..3f62c88 100644 --- a/aep/0026-interactive-execution.md +++ b/aep/0026-interactive-execution.md @@ -3,7 +3,7 @@ | | | | --- | --- | | **AEP** | 0026 | -| **Title** | Interactive execution: the `AgentSession` kind, autonomy levels and per-call confirmation | +| **Title** | Interactive execution: the `AgentSession` kind, autonomy levels, per-call confirmation and agent governance | | **Authors** | @agenticworkflowprotocol | | **Shepherd** | to be assigned (not an author, [aep-process 5.1](../docs/aep-process.md#51-review-before-acceptance)) | | **Type** | Specification | @@ -26,8 +26,8 @@ runtime can run this today only by pretending a session is a workflow with one s AEP adds an execution form for that: the kind `AgentSession`, a sibling of `WorkflowRun`. It also adds autonomy levels with a ceiling that the agent's author sets, a per-action `confirm` setting, the lifecycle, budget scope and audit events of a session, and the narrowing of tool sources and -the choice of a model for one session. It answers runtime feedback G62, G63, G73, G82 and part of -G85. +the choice of a model for one session, and governance fields on `Agent` for executions without a +workflow. It answers runtime feedback G62, G63, G73, G82 and part of G85. ## Motivation @@ -82,6 +82,29 @@ New `spec` field of `Agent`: A session is not possible without the explicit opt-in of the author, because interactive use changes what the agent does more than any input value. +**Governance of an agent that runs on its own.** Inside a workflow, `dataPolicy`, `modelPolicy`, +`environments`, `policies` and `audit` of the workflow apply to the agent (spec 6). A session has +no workflow. New optional `spec` fields of `Agent`, with the same shape as on `Workflow`: + +| Field | Type | Req. | Description | +| ----- | ---- | ---- | ----------- | +| `dataPolicy` | object | no | Spec 7.2, 7.3. | +| `modelPolicy` | object | no | Spec 7.4; also applies to `sessions.models`. | +| `environments` | map | no | Spec 7.10. | +| `policies` | object | no | Spec 8.1: policies the agent includes. | +| `audit` | object | no | Spec 10.2 with the payload levels of AEP-0009. | + +- They apply whenever the agent runs on its own (an `AgentSession`, or a single agent run as a + workflow with one step). +- When a workflow references the agent, the workflow's fields apply as today, and the agent's + fields apply as well: both must allow an operation (the stricter one wins), as for + `permissions` (spec 7.5.4). +- Platforms MAY attach `Policy` objects to an `Agent` with `targetRefs` (AEP-0021 B5); they apply + in addition. +- Under the `security` profile, an agent with `sessions` MUST declare `audit` with a payload level + and, unless the level is `metadata`, `contentRetention` (AEP-0009); otherwise it is invalid. A + session produces prompts and answers, which must have a reviewed retention. + ### New section 7.5.8 (autonomy and confirmation) **Autonomy level.** Each prompt of a session runs at one level: @@ -101,20 +124,23 @@ level, and no level allows an action that permissions deny. | Value | Meaning | | ----- | ------- | | absent | Follows the autonomy level. | -| `always` | Requires a confirmation at every level. In executions without a person (workflow runs) the action is denied. | +| `always` | Requires a confirmation at every level, for every single call: only `allowOnce` or `refuse` (see Confirmation). In executions without a person (workflow runs) the action is denied. | | `never` | Runs without confirmation at `ask` and `auto`; still denied at `readOnly` if it changes state. | When several permission objects apply, the strictest `confirm` wins (`always` over absent over `never`). -**Effective level.** The level that applies to a prompt is the lowest of: the level that the person -selected, `sessions.maxAutonomy`, and the platform ceiling (AEP-0023 section 7.5.7). Only an -identity that may control the session (section 10.9) may change the level. Every change is an -audit event. +**Selecting a level.** A level above `sessions.maxAutonomy` or above the platform ceiling is +rejected, both when the session is created and when a controlling identity changes the level +later (AEP-0023 section 7.5.7: ceilings reject, never adjust). A rejected change leaves the +current level in place and is audited with reason `ceilingExceeded`. Only an identity that may +control the session (section 10.9) may change the level. Every change is an audit event. **Confirmation.** A confirmation names the action, its arguments as the runtime shows them, and the outcome: `allowOnce`, `allowForSession` (the same action and resource for the rest of the -session, never beyond it) or `refuse`. A confirmation is a decision under AEP-0023 section 7.6.1: +session, never beyond it) or `refuse`. For an action with `confirm: always` the runtime MUST +offer only `allowOnce` and `refuse`; it MUST NOT reuse an earlier grant for it, and an +`allowForSession` received for such an action is recorded and applied as `allowOnce`. A confirmation is a decision under AEP-0023 section 7.6.1: it MUST come from an authenticated identity that may control the session, and MUST be decided outside the execution environment. A confirmation is not an approval in the sense of spec 7.6: rules that require an approval (`requireApproval`, approval steps) still require one. @@ -146,7 +172,7 @@ spec: | Field | Type | Req. | Description | | ----- | ---- | ---- | ----------- | | `spec.agentRef` | object | yes | `name` of an `Agent` in the same namespace; `version` and `digest` are assertions as in `WorkflowRun`. | -| `spec.autonomy` | string | no | Level the person selected: `readOnly`, `ask` (default) or `auto`. Capped as in 7.5.8. May change while the session runs. | +| `spec.autonomy` | string | no | Level the person selected: `readOnly`, `ask` (default) or `auto`. A level above `maxAutonomy` or the ceiling is rejected (7.5.8). May change while the session runs. | | `spec.model` | object | no | `model` or one of `sessions.models` of the agent. Anything else is rejected. May change between prompts. | | `spec.toolSources` | list | no | Names of the agent's tool sources to enable. Absent: all. Empty list: none. A name that is not a tool source of the agent is reported in status and ignored. | | `spec.initialPrompt` | string | no | First prompt, sent when the session is ready. | @@ -160,8 +186,8 @@ Rules: - **Starting.** The creator of the object is the actor. It is taken from an authenticated source, as for `WorkflowRun`. The runtime validates the agent (including `sessions`), the model, the - tool sources, the autonomy level and every policy before it starts anything. Otherwise it sets - `phase: rejected`. + tool sources, the autonomy level, the agent's governance fields, every policy and every platform + ceiling before it starts anything. Otherwise it sets `phase: rejected`. - **Control.** The creator may send prompts, confirm actions, change level and model, pause, resume and stop. A runtime MAY let further identities control a session (for example a team maintainer), and MUST document who. Every action of a controlling identity is an audit event with @@ -237,6 +263,13 @@ spec: - type: mcp server: code-scanner tools: [scan] + modelPolicy: + allowedProviders: [example-provider] + environments: + development: {} + audit: + payload: redacted + contentRetention: 30d permissions: default: deny tools: @@ -253,22 +286,26 @@ spec: maxCostUsd: 5 ``` -A person who selects `auto` gets `ask` (the ceiling). Scans run without asking. A `git push` asks -every time. `curl` is denied. +Selecting `auto` is rejected (above `maxAutonomy`); the session keeps `ask`. Scans run without +asking. A `git push` asks every time and can only be allowed once. `curl` is denied. Prompts and +answers are kept 30 days. ## Schema changes - New root kind `AgentSession` with `$defs/AgentSessionSpec`, `$defs/AgentSessionStatus`. -- `$defs/AgentSpec.sessions`; `confirm` enum in `$defs/PermissionToolEntry`. +- `$defs/AgentSpec.sessions`; `dataPolicy`, `modelPolicy`, `environments`, `policies` and + `audit` on `$defs/AgentSpec`; `confirm` enum in `$defs/PermissionToolEntry`. - Semantic rules: `session.agent-not-interactive` (no `sessions`), `session.model-not-allowed`, - `session.autonomy-invalid`, `permissions.confirm-invalid`. + `session.autonomy-invalid`, `session.audit-missing` (security profile), + `permissions.confirm-invalid`. - Kubernetes binding (spec 3.10): plural `agentsessions`, namespaced, `status` subresource. ## Conformance impact - New profile `session`. Valid: `10.9-agent-session.yaml`, `6-agent-sessions.yaml`. Invalid: `10.9-agent-session-model-not-allowed.yaml`, `7.5.8-confirm-unknown.yaml`. -- Runtime tests: a level above `maxAutonomy` is capped; `confirm: always` asks at `auto`; a +- Runtime tests: a level above `maxAutonomy` is rejected and the level stays; `confirm: always` + asks at `auto` and accepts no session-wide grant; a disabled tool source is refused; a confirmation sent from inside the execution environment is not accepted; the budget is summed across a pause. @@ -284,7 +321,7 @@ keep doing so. A runtime that offered interactive use without this AEP needs the agent's own permission system ask the person, inside the sandbox, offers no protection against a command that answers for the person. - `allowForSession` can turn into a broad grant. It is limited to the same action and resource, - and it ends with the session. + it ends with the session, and it never applies to actions with `confirm: always`. - A command allow list (AEP-0002) and confirmations do not restrict what an allowed program runs. The isolation class (AEP-0023) is the boundary for that. - Prompts and repository content are untrusted input (spec 12, runtime feedback G81). A prompt @@ -335,6 +372,9 @@ sessions started by events. 4. Should a session be startable by an event (runtime feedback G86), and is the attested actor of AEP-0024 then its creator? 5. Name: `AgentSession` or `Session`? +6. Is the agent the right place for session governance, or should a platform-level object (a + session class) hold `audit` and `dataPolicy` for all sessions of a namespace? This draft puts + them on the agent so that the reviewed manifest shows them. ## Decision From 1f282e1bfcebd35e00fbd6fc2fd2a2ed837f2b82 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Mon, 23 Nov 2026 19:21:25 +0100 Subject: [PATCH 13/14] docs(aep): review fixes for AEP-0007, 0017, 0024 and 0025 prompts.get is a reserved tool name like resources.read; sampling and roots requests are always declined until an opt-in is defined; human input in unattended engine steps follows humanInput; deduplication of events is per workflow; retention and maxSize of a shared store must be equal in every declaration. Signed-off-by: Simon Lauger --- aep/0007-mcp-connection-catalog.md | 23 +++++++++++++---------- aep/0017-human-input.md | 8 +++++--- aep/0024-event-triggers.md | 7 +++++-- aep/0025-state.md | 6 ++++-- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/aep/0007-mcp-connection-catalog.md b/aep/0007-mcp-connection-catalog.md index 4d9be98..f821ce4 100644 --- a/aep/0007-mcp-connection-catalog.md +++ b/aep/0007-mcp-connection-catalog.md @@ -176,7 +176,11 @@ Rules: entry of `resources` MUST be denied; without `resources`, every read is denied. The runtime MUST filter `resources/list` and `resources/templates/list` to catalogued entries and MUST deny `resources/subscribe` and completions for anything else. A catalog tool named `resources.read` - is rejected (`catalog.reserved-name`). + or `prompts.get` is rejected (`catalog.reserved-name`): both are action identifiers of + protocol operations (rules 7 and 9), and a tool with the same name would share their grants. +8. A catalog is identified by its digest (AEP-0010 over the inline catalog object or the + `McpCatalog` manifest). The reproducibility record (spec 10.7) lists, per MCP server, the catalog + digest and the digests of the tool definitions that were exposed. 9. **Prompts.** Getting a server prompt (`prompts/get`) is the action `.prompts.get` with the prompt name as its resource scope. The runtime MUST filter `prompts/list` to catalogued prompts and deny `prompts/get` for anything else. The content of a prompt is untrusted input @@ -184,12 +188,11 @@ Rules: more authority, and grants nothing. A server prompt and a `Prompt` manifest (AEP-0005) are different things: the manifest is reviewed content of the workflow's owner, a server prompt is content of the server's operator. -10. **Requests of the server.** The runtime MUST NOT relay sampling requests of a server to a model - unless the manifest allows it explicitly; an allowed sampling request is a model call under the - model policy (spec 7.4) and the budget. It MUST NOT answer roots requests with paths of the - execution environment unless allowed. Elicitation follows spec 5.8.2 (declined without - `humanInput`). A runtime SHOULD answer these requests itself rather than pass them to an engine - inside the execution environment. +10. **Requests of the server.** The runtime MUST decline every sampling request (the server asks + the client to call a model) and every roots request (the server asks for paths of the client) + of a server; this version defines no way to allow them (open question 5). Elicitation follows + spec 5.8.2 (declined without `humanInput`). A runtime SHOULD answer these requests itself + rather than pass them to an engine inside the execution environment, which might answer them. 11. **Resolution.** When the runtime resolves a server from its own configuration (spec 5.5.1), the order is: the manifest's declaration, then the runtime binding, then the runtime's catalog. A declaration and the resolved server MUST NOT contradict each other (transport, URL, catalog @@ -198,9 +201,6 @@ Rules: 12. **Unattended executions.** For executions without a person, a tool source SHOULD list its tools explicitly; under `security`, `.*` grants only tools that are catalogued, so a tool the server adds later is not exposed (rule 3). -8. A catalog is identified by its digest (AEP-0010 over the inline catalog object or the - `McpCatalog` manifest). The reproducibility record (spec 10.7) lists, per MCP server, the catalog - digest and the digests of the tool definitions that were exposed. ### Changes to section 5.6.1 @@ -369,6 +369,9 @@ resources are allowed (runtime feedback G69 to G72). No definition digests yet. manifest. 4. Should the definition digest include `icons` (display only) or members added by later MCP revisions? +5. Sampling and roots: is there a use case that needs them? If so, an opt-in per server (for + example `sampling` with a model and a budget, counted as a model call under the model policy, + and `roots` with workspace paths). Until then, rule 10 declines both. ## Decision diff --git a/aep/0017-human-input.md b/aep/0017-human-input.md index 5b068de..c1594e0 100644 --- a/aep/0017-human-input.md +++ b/aep/0017-human-input.md @@ -72,9 +72,11 @@ Applied in [spec/v1alpha3 section 5.8](../spec/v1alpha3/README.md#58-human-input requests go to the identities that may control the session; `answerers` is not needed. The request is answered in the session's user interface, audited with the same events, and the session shows `waiting` while it is open. An answer stays information and is never a - confirmation of an action (AEP-0026) or an approval. Without a person (a paused session, an - unattended engine step) requests are declined. An engine's own question tool maps to agent - requests; questions it would ask outside this mechanism are declined. + confirmation of an action (AEP-0026) or an approval. In a paused session an open request + waits until the session resumes (timeouts still apply). An unattended engine step (AEP-0027) + is an agent step like any other: with `humanInput`, its requests go to the `answerers` as in + item 2; without it, they are declined. An engine's own question tool maps to agent requests; + questions it would ask outside this mechanism are declined. ## Examples diff --git a/aep/0024-event-triggers.md b/aep/0024-event-triggers.md index 2766c64..79b9521 100644 --- a/aep/0024-event-triggers.md +++ b/aep/0024-event-triggers.md @@ -86,8 +86,11 @@ redirect it by prompt. It found: ### Duplicates, concurrency and rate -- The runtime MUST NOT start a second execution for an event with the same `source` and `id` - within a deduplication window. It MUST state the window in its conformance statement; the +- Deduplication is per workflow: the runtime MUST NOT start a second execution **of the same + workflow** for an event with the same `source` and `id` within a deduplication window. An event + that matches several workflows starts each of them once. If several trigger entries of one + workflow match the same event, the workflow starts once, with the first matching entry recorded + in `status.trigger.index`. It MUST state the window in its conformance statement; the window MUST be at least 24 hours. A rejected duplicate MUST be recorded as `trigger.skipped` with reason `duplicate`. - An `event` trigger MAY have `concurrencyPolicy` with the values and semantics of a `schedule` diff --git a/aep/0025-state.md b/aep/0025-state.md index 5c4acc1..7733357 100644 --- a/aep/0025-state.md +++ b/aep/0025-state.md @@ -67,8 +67,10 @@ feedback G03, G53 and G58. declared. - **Sharing.** Workflows with the same `spec.owner` in the same namespace that declare a store of the same `name` share it. If their `classification` values differ, the strictest applies to - every reader. A runtime MUST reject a declaration that would give a workflow of another owner - access. + every reader. `retention` and `maxSize` MUST be equal in every declaration of a shared store + (or absent in all of them); a runtime MUST reject a workflow whose declaration differs from the + store's existing declarations, with reason `stateConflict`, instead of choosing one value. A + runtime MUST reject a declaration that would give a workflow of another owner access. - **Concurrent writers.** The runtime MUST make each write of a file or key atomic. It MUST state in its conformance statement whether concurrent executions writing the same store are serialised or last-writer-wins. With `readWrite`, a step MUST NOT see a partially written value. From f1d628f53b59afae1674fd159f7cfe8381b7f435 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Mon, 23 Nov 2026 19:41:06 +0100 Subject: [PATCH 14/14] docs(aep): second review, mechanical fixes Section numbers of AEP-0023 (7.5.8 to 7.5.10), AEP-0026 (7.5.11) and AEP-0027 (5.4.5) no longer collide with AEP-0002. Examples are valid again (no empty environment entry, notifier agent declared, scalar filter value), the engine example uses a neutral type name, leftovers of capping are removed and spec 5.7 is amended, session.started gets its required data, tool sources of a session are identified by server or name, mapped IPv6 CIDRs are rejected, and G63 and G68 are marked as partly shown. Signed-off-by: Simon Lauger --- aep/0005-prompt-kind.md | 4 ++-- aep/0007-mcp-connection-catalog.md | 2 +- aep/0021-extension-model.md | 2 +- aep/0023-step-isolation.md | 30 ++++++++++++++++++------------ aep/0024-event-triggers.md | 2 +- aep/0026-interactive-execution.md | 25 ++++++++++++++----------- aep/0027-agent-engine.md | 20 +++++++++++++------- docs/runtime-feedback.md | 4 ++-- 8 files changed, 52 insertions(+), 37 deletions(-) diff --git a/aep/0005-prompt-kind.md b/aep/0005-prompt-kind.md index 9d9cf0e..3c3e54c 100644 --- a/aep/0005-prompt-kind.md +++ b/aep/0005-prompt-kind.md @@ -90,8 +90,8 @@ library instead of typing it. Additional optional `spec` fields: Rules: - Such a prompt is plain user input: it runs with the permissions, budget and autonomy level of the - execution, can never extend them, and a suggested level is capped like any level the person - selects. + execution, can never extend them, and a suggested level above the agent's `maxAutonomy` or the + ceiling is rejected like any level the person selects (AEP-0026); the session keeps its level. - Variables are filled by the person; for a free-text argument a prompt declares one `string` variable (runtimes MAY map it to the argument convention of their engine). - A server prompt of an MCP server (AEP-0007 rule 9) is not a `Prompt` manifest. diff --git a/aep/0007-mcp-connection-catalog.md b/aep/0007-mcp-connection-catalog.md index f821ce4..6ef6578 100644 --- a/aep/0007-mcp-connection-catalog.md +++ b/aep/0007-mcp-connection-catalog.md @@ -197,7 +197,7 @@ Rules: the order is: the manifest's declaration, then the runtime binding, then the runtime's catalog. A declaration and the resolved server MUST NOT contradict each other (transport, URL, catalog digest); a runtime MUST reject the manifest instead of substituting a different server. A - platform ceiling (AEP-0023 section 7.5.7) MAY restrict which servers are usable. + platform ceiling (AEP-0023 section 7.5.10) MAY restrict which servers are usable. 12. **Unattended executions.** For executions without a person, a tool source SHOULD list its tools explicitly; under `security`, `.*` grants only tools that are catalogued, so a tool the server adds later is not exposed (rule 3). diff --git a/aep/0021-extension-model.md b/aep/0021-extension-model.md index bd1f5f0..ec76348 100644 --- a/aep/0021-extension-model.md +++ b/aep/0021-extension-model.md @@ -274,7 +274,7 @@ spec: defines only `targetRefs`, the status and the rules below. - **Targets.** A binding targets a `Workflow` or an `Agent`. An `Agent` binding configures how the runtime runs that agent on its own, for example as an interactive session (AEP-0026): image or - runtime profile, model alternatives, secret mapping. For an agent used inside a workflow, the + runtime profile, a mapping or narrowing of the agent's model alternatives (never new ones), secret mapping. For an agent used inside a workflow, the workflow's binding applies. Bindings carry the discovery label `awp.agenticworkflowprotocol.org/binding: "true"`; the target gets a condition `Bound`. - **One accepted binding per workflow and runtime.** Several bindings of one runtime on the same diff --git a/aep/0023-step-isolation.md b/aep/0023-step-isolation.md index 4eb1d81..bed81f9 100644 --- a/aep/0023-step-isolation.md +++ b/aep/0023-step-isolation.md @@ -100,9 +100,9 @@ credentials and approvals are the three cases a proof of concept met in practice | Field | Type | Description | | ----- | ---- | ----------- | | `network.egress` | string | `allow` or `deny`: outbound network access of command steps and built-in tools. Default `allow`; under the `security` profile the default is `deny`. | -| `network.allowTo` | list | Destinations reachable when `egress` is `deny`, as objects of section 7.5.5. Replaces `allowHosts`. | +| `network.allowTo` | list | Destinations reachable when `egress` is `deny`, as objects of section 7.5.8. Replaces `allowHosts`. | -### New section 7.5.5 (network destinations) +### New section 7.5.8 (network destinations) An entry of `allowTo` is an object. Its fields follow the egress rules of a Kubernetes `NetworkPolicy` (`ipBlock.cidr`, `ipBlock.except`, `ports`), without the nesting, so that a rule @@ -121,7 +121,7 @@ Rules: first label of `host` is invalid, and so is a bare `*`. `host` MUST NOT contain a port, an address or a CIDR. Validators MUST reject invalid entries. - `host` entries are matched against the name the step requested, before resolution. `cidr` - entries are matched against the resolved address, after normalisation (7.5.6). + entries are matched against the resolved address, after normalisation (7.5.9). - A connection is allowed if one entry matches its destination and, when the entry has `ports`, its port and protocol. @@ -129,7 +129,7 @@ Informative mapping: a `cidr` entry becomes an `ipBlock` with `except` and `port `NetworkPolicy`; a `host` entry needs a mechanism that matches names, for example the FQDN rules of a network plugin (`toFQDNs` with `toPorts`) or the allow list of an egress proxy. -### New section 7.5.6 (enforcement and platform ceilings) +### New section 7.5.9 (enforcement and platform ceilings) - **Effective network.** A platform MAY set a ceiling on the network access of executions (for example per namespace, tenant or runtime installation). The effective network access of a @@ -231,9 +231,9 @@ under the same user ID as the step's commands is not. Firecracker for `vm`) is platform configuration. - The conformance statement lists which classes the runtime provides and by which mechanism. -### New section 7.5.7 (platform ceilings in general) +### New section 7.5.10 (platform ceilings in general) -7.5.6 defines the network ceiling. The same rule applies to every ceiling that a platform sets +7.5.9 defines the network ceiling. The same rule applies to every ceiling that a platform sets (permissions, models, tool servers, network, autonomy, isolation, budgets): **a ceiling never changes a manifest silently, it rejects.** @@ -249,12 +249,17 @@ changes a manifest silently, it rejects.** - A runtime SHOULD make ceilings visible to authors before they apply a manifest (for example in the status of a binding or a validation command). +Change to spec 5.7: replace "Runtimes MAY enforce stricter limits than the manifest declares (for +example tenant quotas)" with "A runtime that enforces a stricter limit than the manifest declares +(for example a tenant quota) MUST reject the manifest or execution as in section 7.5.10; it MUST +NOT lower a limit silently." + Rejecting instead of adjusting keeps the reviewed manifest the truth: an execution never runs with a budget, a model or an autonomy level that differs from what the reviewer saw. ### Change to the profile table (spec 11) -`security`: add "network enforcement or rejection (7.5.6), internal destinations (7.5.6), model +`security`: add "network enforcement or rejection (7.5.9), internal destinations (7.5.9), model credentials outside steps (7.9), tool server credentials outside steps (5.5.1), approval authority outside steps (7.6.1), isolation class enforced or rejected (5.4)". @@ -338,7 +343,8 @@ is denied. `/128`, and a CIDR to `{cidr: ...}`. - Semantic rules: `permissions.network.host-invalid` (wildcards outside the first label, bare `*`, a port or address in `host`), `permissions.network.cidr-invalid`, `except-outside-cidr`, - `port-range-invalid` (`endPort` below `port`). + `port-range-invalid` (`endPort` below `port`), `cidr-embedded-ipv4` (a `cidr` inside + `::ffff:0:0/96` or `::/96`, which never matches a normalised address: write the IPv4 range). - `agents[].isolation`: enum `process`, `container`, `sandbox`, `vm`. ## Conformance impact @@ -347,10 +353,10 @@ is denied. - `security`: default `egress: deny`, internal destinations, model and tool server credentials, approval authority, isolation class. - Valid: `5.4-agent-isolation.yaml`. Invalid: `5.4-agent-isolation-unknown.yaml`. -- Valid: `7.5.5-allow-to-forms.yaml`. Invalid: `7.5.5-allow-to-string-entry.yaml`, - `7.5.5-allow-to-bare-wildcard.yaml`, `7.5.5-allow-to-host-with-port.yaml`, - `7.5.5-allow-to-host-and-cidr.yaml`, `7.5.5-allow-to-except-outside.yaml`, - `7.5.5-allow-to-port-range.yaml`. +- Valid: `7.5.8-allow-to-forms.yaml`. Invalid: `7.5.8-allow-to-string-entry.yaml`, + `7.5.8-allow-to-bare-wildcard.yaml`, `7.5.8-allow-to-host-with-port.yaml`, + `7.5.8-allow-to-host-and-cidr.yaml`, `7.5.8-allow-to-except-outside.yaml`, + `7.5.8-allow-to-port-range.yaml`. - Runtime tests (once a runtime suite exists): a host that resolves to a private address; a redirect to `169.254.169.254`; a AAAA record `::ffff:169.254.169.254`; an address in `64:ff9b::/96`; a DNS answer that changes between two lookups; a ceiling that diff --git a/aep/0024-event-triggers.md b/aep/0024-event-triggers.md index 79b9521..a53b2ef 100644 --- a/aep/0024-event-triggers.md +++ b/aep/0024-event-triggers.md @@ -155,7 +155,7 @@ spec: source: chat.example.com eventType: com.example.chat.message.posted filter: - data.mentions: assistant + data.mentioned: "true" # a scalar; equality on lists is undefined concurrencyPolicy: allow rateLimit: maxExecutions: 20 diff --git a/aep/0026-interactive-execution.md b/aep/0026-interactive-execution.md index 3f62c88..914741f 100644 --- a/aep/0026-interactive-execution.md +++ b/aep/0026-interactive-execution.md @@ -74,7 +74,7 @@ New `spec` field of `Agent`: | Field | Type | Req. | Description | | ----- | ---- | ---- | ----------- | | `sessions` | object | no | Whether and how the agent may run interactively. Absent: the agent MUST NOT run as an `AgentSession`. | -| `sessions.maxAutonomy` | string | no | Highest autonomy level (section 7.5.8): `readOnly`, `ask` (default) or `auto`. | +| `sessions.maxAutonomy` | string | no | Highest autonomy level (section 7.5.11): `readOnly`, `ask` (default) or `auto`. | | `sessions.models` | list | no | Alternatives to `model` that a session may choose, model objects as in [section 5.4.3](../spec/v1alpha3/README.md#543-model-object). `model` stays the default. | | `sessions.idleTimeout` | duration | no | Time without a prompt after which the runtime pauses the session. Default: implementation-defined, stated in the conformance statement. | | `sessions.maxDuration` | duration | no | Time after which the runtime ends the session, paused time not counted. | @@ -105,7 +105,7 @@ no workflow. New optional `spec` fields of `Agent`, with the same shape as on `W and, unless the level is `metadata`, `contentRetention` (AEP-0009); otherwise it is invalid. A session produces prompts and answers, which must have a reviewed retention. -### New section 7.5.8 (autonomy and confirmation) +### New section 7.5.11 (autonomy and confirmation) **Autonomy level.** Each prompt of a session runs at one level: @@ -132,7 +132,7 @@ When several permission objects apply, the strictest `confirm` wins (`always` ov **Selecting a level.** A level above `sessions.maxAutonomy` or above the platform ceiling is rejected, both when the session is created and when a controlling identity changes the level -later (AEP-0023 section 7.5.7: ceilings reject, never adjust). A rejected change leaves the +later (AEP-0023 section 7.5.10: ceilings reject, never adjust). A rejected change leaves the current level in place and is audited with reason `ceilingExceeded`. Only an identity that may control the session (section 10.9) may change the level. Every change is an audit event. @@ -172,9 +172,9 @@ spec: | Field | Type | Req. | Description | | ----- | ---- | ---- | ----------- | | `spec.agentRef` | object | yes | `name` of an `Agent` in the same namespace; `version` and `digest` are assertions as in `WorkflowRun`. | -| `spec.autonomy` | string | no | Level the person selected: `readOnly`, `ask` (default) or `auto`. A level above `maxAutonomy` or the ceiling is rejected (7.5.8). May change while the session runs. | +| `spec.autonomy` | string | no | Level the person selected: `readOnly`, `ask` (default) or `auto`. A level above `maxAutonomy` or the ceiling is rejected (7.5.11). May change while the session runs. | | `spec.model` | object | no | `model` or one of `sessions.models` of the agent. Anything else is rejected. May change between prompts. | -| `spec.toolSources` | list | no | Names of the agent's tool sources to enable. Absent: all. Empty list: none. A name that is not a tool source of the agent is reported in status and ignored. | +| `spec.toolSources` | list | no | Tool sources of the agent to enable, identified by `server` for `mcp` sources and `name` for `builtin` sources (spec 5.5.2); an agent whose tool sources are not unique by this identifier cannot run as a session. Absent: all. Empty list: none. An identifier that is not a tool source of the agent is rejected. | | `spec.initialPrompt` | string | no | First prompt, sent when the session is ready. | | `spec.promptRef` | object | no | A `Prompt` (AEP-0005) used as the first prompt instead of `initialPrompt`. | | `spec.environment` | string | no | Target environment (spec 7.10). | @@ -192,8 +192,9 @@ Rules: and stop. A runtime MAY let further identities control a session (for example a team maintainer), and MUST document who. Every action of a controlling identity is an audit event with that identity. A prompt is user input: it cannot change permissions, policies or budgets. -- **Narrowing only.** `toolSources` and `model` can only select from what the agent declares, - intersected with the platform ceiling. A runtime MUST NOT offer a tool source that is not +- **Narrowing only.** `toolSources` and `model` can only select from what the agent declares. A + model or tool source that the platform ceiling does not allow has already rejected the agent + (AEP-0023 section 7.5.10); selecting one in a session is rejected the same way. A runtime MUST NOT offer a tool source that is not enabled. Calls to such a source are refused, and its permissions are irrelevant for this session. If a change cannot take effect while the session runs, the runtime reports this in status and applies the change on the next resume. @@ -222,12 +223,16 @@ a person is pending. | Event | When | | ----- | ---- | -| `session.started`, `session.ready`, `session.paused`, `session.resumed`, `session.finished`, `session.failed` | Lifecycle. | +| `session.started` | The session was admitted. Required `data`: `agent` (`name`, `version`, `digest` of the pinned manifest, as `workflow` in `workflow.started`), `autonomy`, `model`, `toolSources`. | +| `session.ready`, `session.paused`, `session.resumed`, `session.finished`, `session.failed` | Lifecycle. | | `session.prompt` | A prompt was sent (actor, length; content only at the payload level of AEP-0009). | | `session.autonomy.changed`, `session.model.changed`, `session.toolSources.changed` | A controlling identity changed the session (actor, from, to). | | `action.confirmationRequested` | The runtime asks a person to confirm an action. | | `action.confirmed`, `action.refused` | The outcome, with the identity that decided and the scope (`once`, `session`). | +In a session, events of spec 10.4 that carry `stepId` (for example `tool.*`) have no `stepId`; +`executionId` identifies the session. + These events SHOULD come from the component outside the execution environment that decides (AEP-0023 section 7.6.1, runtime feedback G76). @@ -265,8 +270,6 @@ spec: tools: [scan] modelPolicy: allowedProviders: [example-provider] - environments: - development: {} audit: payload: redacted contentRetention: 30d @@ -303,7 +306,7 @@ answers are kept 30 days. ## Conformance impact - New profile `session`. Valid: `10.9-agent-session.yaml`, `6-agent-sessions.yaml`. Invalid: - `10.9-agent-session-model-not-allowed.yaml`, `7.5.8-confirm-unknown.yaml`. + `10.9-agent-session-model-not-allowed.yaml`, `7.5.11-confirm-unknown.yaml`. - Runtime tests: a level above `maxAutonomy` is rejected and the level stays; `confirm: always` asks at `auto` and accepts no session-wide grant; a disabled tool source is refused; a confirmation sent from inside the execution environment is diff --git a/aep/0027-agent-engine.md b/aep/0027-agent-engine.md index 5cbe276..3f88f26 100644 --- a/aep/0027-agent-engine.md +++ b/aep/0027-agent-engine.md @@ -62,7 +62,7 @@ New field `engine` on inline agents and in `Agent` manifests: | Field | Type | Req. | Description | | ----- | ---- | ---- | ----------- | -| `engine.type` | string | yes | The engine, a domain-prefixed value or a name from a registry this repository keeps (for example `opencode`). A runtime that does not support the type MUST reject the manifest. | +| `engine.type` | string | yes | The engine, a domain-prefixed value or a name from a registry this repository keeps (for example `example.com/coding-agent`). A runtime that does not support the type MUST reject the manifest. | | `engine.runtimeProfile` | string | no | A runtime-defined profile for image and resources. It MUST NOT weaken `isolation` (AEP-0023). | | `engine.workspace.repositories` | list | no | `url` (https, expression-enabled), `ref` (branch, tag or commit, expression-enabled), `path`. Cloned before the engine starts; the commit each one starts from is recorded as its base. | | `engine.workspace.trustRepositoryConfig` | list | no | Kinds of workspace configuration the engine may load: `instructions` (agent instruction files), `skills`, `commands`, `toolchain` (tool manager configuration). Default: none. | @@ -72,7 +72,7 @@ New field `engine` on inline agents and in `Agent` manifests: `inputs.*`, `event.*` (AEP-0004) and `execution.*`. A resolved `url` is subject to the effective network (AEP-0023) like any other destination. -### New section 5.4.6 (engine semantics) +### New section 5.4.5 (engine semantics) - **Permissions.** The runtime maps the effective permissions (spec 7.5.4) to the engine. In unattended executions an action is allowed or denied. There is nobody to ask, so `confirm: @@ -91,8 +91,10 @@ network (AEP-0023) like any other destination. - **Outputs.** The engine produces the declared outputs of the step through the completion mechanism of AEP-0018, with types and schemas from AEP-0003 where present. A runtime also provides `summary` (the engine's final answer) and `diff` (changes against the base) if the step - declares them. A step that pushes MUST declare `branch` and `commit`, so that the execution - records what left the workspace. + declares them. Every workflow step that uses an agent with `engine.push` MUST declare the + outputs `branch` and `commit`, so that the execution records what left the workspace. In an + `AgentSession` (AEP-0026) there are no outputs; a push is an action under `git.push` and its + confirmation, and the audit event records branch and commit. - **Push.** `push` requires the action `git.push`, and pushes only to `branch` of `repository`. - **Credentials.** Clone and push credentials are workflow secrets (spec 7.9). Under `security` they MUST NOT be visible to the engine. The runtime clones and pushes outside the engine, or removes @@ -105,7 +107,7 @@ network (AEP-0023) like any other destination. ### Profile `engine` (spec 11) -New profile with `engine` and section 5.4.6. The conformance statement lists the supported engine +New profile with `engine` and section 5.4.5. The conformance statement lists the supported engine types, the action mapping of their built-in tools, and which workspace configuration kinds they can disable. @@ -130,7 +132,7 @@ spec: - id: scanner isolation: sandbox engine: - type: opencode + type: example.com/coding-agent workspace: repositories: - url: ${{ event.data.repository }} @@ -148,6 +150,10 @@ spec: tools: code-scanner.scan: {allow: true} file.read: {allow: true} + - id: notifier + model: + provider: example-provider + name: example-model workflow: - id: scan agent: scanner @@ -220,7 +226,7 @@ enforce their own compliance requirements. This proposal makes no compliance pro ## Implementation status -A proof-of-concept Kubernetes runtime runs agent steps with OpenCode through an extension field of +A proof-of-concept Kubernetes runtime runs agent steps with an open-source coding agent through an extension field of this shape (with the repositories fixed and the outputs limited to `summary` and `diff`). The runtime disables project configuration and external skills of the engine. A security scan workflow ran with it on a test installation, started by hand and by a CloudEvent: the engine diff --git a/docs/runtime-feedback.md b/docs/runtime-feedback.md index 1ce13af..6ecbceb 100644 --- a/docs/runtime-feedback.md +++ b/docs/runtime-feedback.md @@ -212,12 +212,12 @@ failed only after the decision moved to a separate container. | ID | Sev. | Gap | Proposal from the runtime | Home | Status | | --- | --- | --- | --- | --- | --- | | G62 | must | Interactive execution. Spec 6 runs a standalone agent as a workflow with one step. A session has no task and no outputs: a person sends prompts for hours, the session pauses when idle, resumes, and ends when the person stops it. Its lifecycle, budget scope and audit events (created, idle, resumed, waiting for a person, finished) are undefined. | An execution form `Session` next to `WorkflowRun`, with lifecycle, budget scope and events. | new AEP: [AEP-0026](../aep/0026-interactive-execution.md) | shown; the runtime treats a whole session as one execution for permissions, budget and audit | -| G63 | must | Permissions are only `allow` or `deny`. In a session a person confirms single tool calls and switches between read-only, confirm-each-call and autonomous during the session. AWP says neither who may switch nor whether an author can forbid autonomy, and confirmations are neither approvals nor audited. | An effect `ask` for interactive execution. An autonomy ceiling in the manifest that the platform can only lower. Audit events for confirmed and refused calls and for mode changes. | AEP-0026 | shown | +| G63 | must | Permissions are only `allow` or `deny`. In a session a person confirms single tool calls and switches between read-only, confirm-each-call and autonomous during the session. AWP says neither who may switch nor whether an author can forbid autonomy, and confirmations are neither approvals nor audited. | An effect `ask` for interactive execution. An autonomy ceiling in the manifest that the platform can only lower. Audit events for confirmed and refused calls and for mode changes. | AEP-0026 | partly shown: mode switching and audited confirmations ran; `confirm` per action and the author ceiling (`maxAutonomy`) are not built | | G64 | must | Approval authority inside the execution environment. The engine and its commands share a user ID: a command read the engine's server password and could answer its own permission requests. A process in the sandbox sent a prompt with the autonomous mode and answered every question itself. | Under the `security` profile, confirmations and approvals are decided outside the execution environment, by an authenticated person, over a channel the environment cannot reach. Nothing that carries an approval (passwords, tokens, signed grants) is readable inside. | [AEP-0023](../aep/0023-step-isolation.md) | shown: the attack succeeded while the engine decided, and failed after the decision moved to a separate container with signed grants; the counter-test through the console asked once and ran after "allow once" | | G65 | must | Engine of an agent. A coding agent brings its own tool loop, file editing and shell use. No field says which engine runs an agent, what it receives and produces, how permissions map to it, or whether its subagents inherit permissions and budget. The runtime uses an extension field. | `agents[].engine` (`type`, `runtimeProfile`, `repositories`, `push`). Allow or deny only when unattended. A refused call fails the step. Subagents inherit permissions and budget. Unknown engines are rejected. | new AEP: [AEP-0027](../aep/0027-agent-engine.md); until then `extensionRef` ([AEP-0021](../aep/0021-extension-model.md) B3) | shown: a workflow ran its review step with the engine, started by hand and by an event | | G66 | should | Engine steps produce only a summary and a diff. A step that declares outputs such as `critical` and `high` is rejected, and its repositories are fixed, so an event cannot pass one. | The engine fills declared outputs through the completion tool of AEP-0018 with the schema of AEP-0003. `repositories` is expression-enabled with `inputs.*` and `event.*`. | AEP-0027 | shown (the rejection) | | G67 | should | Agents that run untrusted code need stronger isolation than a container. The manifest cannot require it: the runtime class sits in the binding, invisible to reviewers. | A minimum `agents[].isolation` (`container`, `sandbox`, `vm`) that a runtime meets or rejects. The mechanism is platform configuration. | AEP-0023 | mapping implemented; no class above `container` deployed | -| G68 | should | Ceilings. AEP-0023 defines a network ceiling, but not whether ceilings reject or cap. The runtime rejects models, hosts and MCP servers outside its tenant ceiling and caps cost. Tenants also limit tool sources, autonomy and concurrent sessions. | A ceiling never adjusts a manifest: anything above it (model, tool source, destination, autonomy, isolation the platform cannot provide, budget) is rejected, and under a budget ceiling the manifest must declare the limit. Revised after review on 2026-11-23 (the first draft capped budgets). | AEP-0023 | shown | +| G68 | should | Ceilings. AEP-0023 defines a network ceiling, but not whether ceilings reject or cap. The runtime rejects models, hosts and MCP servers outside its tenant ceiling and caps cost. Tenants also limit tool sources, autonomy and concurrent sessions. | A ceiling never adjusts a manifest: anything above it (model, tool source, destination, autonomy, isolation the platform cannot provide, budget) is rejected, and under a budget ceiling the manifest must declare the limit. Revised after review on 2026-11-23 (the first draft capped budgets). | AEP-0023 | partly shown: models, hosts and MCP servers outside the tenant ceiling reject; cost limits are still capped, unlike the revised proposal | | G69 | should | MCP credentials. Spec 5.5.1 `auth.secretRef` hands the credential to the MCP client. When the client is a coding agent in a sandbox, the agent and every command can read it. | Under the `security` profile, tool server credentials stay outside the execution environment, like model credentials (G61). A gateway authenticates the execution with a short-lived ticket, and `auth` may be satisfied by the runtime. | AEP-0023 | shown: the static analysis server is reachable only through the gateway, with a session ticket and a step ticket | | G70 | should | Resolution of MCP servers from runtime configuration (5.5.1). The order, partial declarations and substitution are undefined. | Resolve declaration first, then binding, then catalog. A declaration and the resolved server must not contradict each other. | [AEP-0007](../aep/0007-mcp-connection-catalog.md) | implemented, integration tests | | G71 | should | `server.*` also allows tools that a server adds after the review, and unattended steps run them unseen. | An explicit tools list for unattended executions. Tool annotations are untrusted unless the platform pins the server. | AEP-0007 | shown: the catalog hides two tools of the server, and calls to them are refused |