From c4709d17407bbab64f1e48c63fe9b3c708ef2143 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Mon, 23 Nov 2026 20:09:19 +0100 Subject: [PATCH 1/2] docs(aep): AEP-0026 interactive execution and AEP-0027 agent engine as concepts, amendments from sessions AEP-0026 adds the kind AgentSession, an opt-in on Agent with a ceiling for autonomy and three autonomy levels; confirmation per action, governance without a workflow, questions and history are open questions. AEP-0027 adds agents[].engine with fixed repositories and repository configuration off by default; outputs, push and repositories from events are open questions. Amendments: MCP prompts and resources as allow lists (AEP-0007), shell resources and command mapping (AEP-0002), prompts as session tasks (AEP-0005), event origin (AEP-0009), streaming budgets (AEP-0013). Signed-off-by: Simon Lauger --- CHANGELOG.md | 2 + aep/0002-tool-argument-constraints.md | 41 +++++ aep/0005-prompt-kind.md | 14 ++ aep/0007-mcp-connection-catalog.md | 49 +++++- aep/0009-audit-payload-levels.md | 23 +++ aep/0013-runtime-clarifications.md | 11 ++ aep/0026-interactive-execution.md | 214 ++++++++++++++++++++++++++ aep/0027-agent-engine.md | 170 ++++++++++++++++++++ docs/runtime-feedback.md | 4 +- spec/README.md | 2 + 10 files changed, 523 insertions(+), 7 deletions(-) create mode 100644 aep/0026-interactive-execution.md create mode 100644 aep/0027-agent-engine.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a6889d..cd5e500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ API versions (`v1alpha1`, ...) are versioned separately, see [GOVERNANCE.md](GOV ### Changed +- Amendments from interactive sessions: AEP-0007 server prompts and resources as allow lists with default none (answers its open question 3), `prompts.get` reserved, sampling and roots declined; AEP-0002 resource scope of `shell.execute` and mapping of commands to well-known actions through `actionGroups`; AEP-0005 prompts as session tasks; AEP-0009 `origin` of audit events; AEP-0013 budgets during streaming (runtime feedback G71, G72, G74 to G76, G78). - AEP-0021 B4: `triggers[].source` is no domain-prefixed value space; it is the CloudEvents `source` of the event producer (runtime feedback G54). B6: bindings may also target an `Agent`. - 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). @@ -32,6 +33,7 @@ API versions (`v1alpha1`, ...) are versioned separately, see [GOVERNANCE.md](GOV ### Added +- AEP-0026 (interactive execution: kind `AgentSession`, `sessions` opt-in with `maxAutonomy`, three autonomy levels) and AEP-0027 (agent engine: `agents[].engine`, repository configuration off by default) as Draft concepts with open questions; numbers to be confirmed. From runtime feedback G62, G63, G65, G73, G81, G82. - AEP-0023 (step isolation) as Draft for `v1alpha3`: structured network destinations (`allowTo` with `host` or `cidr` and `ports`, replacing `allowHosts`), enforce or reject, internal destinations only through a `cidr` entry under `security`, platform ceilings that reject and never adjust (with a change to spec 5.7), credentials and approvals outside the execution environment, a minimum isolation class; hardening as informative implementer guidance. From runtime feedback G10, G47, G49 to G51, G61, G64, G67 to G69. - `docs/runtime-feedback.md`: gaps G41 to G87 (event triggers, the concept review, models, interactive sessions and a coding agent engine), with the AEP each belongs to, the evidence from the runtime, and a rule for what goes into AWP (section 10). - AEP-0024 (event triggers with CloudEvents) and AEP-0025 (state across executions) as Draft for `v1alpha3`, from runtime feedback G03, G42 to G46, G53, G54, G56 and G58. diff --git a/aep/0002-tool-argument-constraints.md b/aep/0002-tool-argument-constraints.md index 6fea7ee..37ab150 100644 --- a/aep/0002-tool-argument-constraints.md +++ b/aep/0002-tool-argument-constraints.md @@ -96,6 +96,41 @@ 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. **Mapping commands to well-known actions.** An entry of `actionGroups` (spec 5.5.4) MAY be an + object `{action, resources}` instead of an action identifier. The group then contains the action + only for calls whose resource matches one of the patterns, and the runtime checks every simple + command of a line against such entries too, so rules on the well-known action apply: + + ```yaml + actionGroups: + git.push: + - action: shell.execute + resources: ["git push*"] + ``` + + Without such a mapping, `git push` in a shell is only `shell.execute`, and rules on `git.push` + do not apply to it. Aliases and scripts (`make release`) are not recognised; network rules are + the boundary for them. +7. 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 +233,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..9f0c651 100644 --- a/aep/0005-prompt-kind.md +++ b/aep/0005-prompt-kind.md @@ -75,6 +75,15 @@ 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 be offered as a reusable task of an interactive execution +(AEP-0026), for example a security review that people start from a library instead of typing it. +Such a prompt is plain user input: it runs with the permissions, budget and autonomy level of the +session and can never extend them. A server prompt of an MCP server (AEP-0007 rule 9) is not a +`Prompt` manifest. Open: fields for a library (title, which agents a prompt fits, a suggested +autonomy level). + ### Reproducibility record (section 10.7) `agents[].prompt`: `name`, `version`, `digest` of the resolved `Prompt` manifest. @@ -167,6 +176,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..74caaba 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,12 +172,30 @@ 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` - is rejected (`catalog.reserved-name`). + 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` + 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 + (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 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. **Unattended executions.** For executions without a person, a tool source SHOULD list its tools + explicitly; `.*` grants only catalogued tools, so a tool the server adds later is not + exposed (rule 3). ### Changes to section 5.6.1 @@ -321,15 +344,31 @@ 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? +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. +6. Resolution of servers from runtime configuration (G70): order declaration, binding, catalog, and + no substitution of a server that contradicts the declaration? ## Decision diff --git a/aep/0009-audit-payload-levels.md b/aep/0009-audit-payload-levels.md index 659ef30..f20f9c5 100644 --- a/aep/0009-audit-payload-levels.md +++ b/aep/0009-audit-payload-levels.md @@ -82,6 +82,22 @@ 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 what leaves the execution environment (model calls, calls to tool + servers, approvals and confirmations) MUST have origin `runtime`. The outcome of an action that + runs inside (a shell command) can only be reported from inside and keeps origin + `executionEnvironment`; a runtime documents which events it cannot verify. + +Open: whether tool arguments sent to tool sources (G77) and the history of interactive executions +(G85) need their own rules beyond `contentRetention`. + ## Examples ```yaml @@ -143,6 +159,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/0026-interactive-execution.md b/aep/0026-interactive-execution.md new file mode 100644 index 0000000..fa74907 --- /dev/null +++ b/aep/0026-interactive-execution.md @@ -0,0 +1,214 @@ +# AEP-0026: Interactive execution + +| | | +| --- | --- | +| **AEP** | 0026 | +| **Title** | Interactive execution: the `AgentSession` kind and autonomy levels | +| **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** | new profile `session` | +| **Created** | 2026-11-23 | +| **Discussion** | issue to be opened | +| **Supersedes** | - | +| **Superseded-by** | - | + +## Summary + +People use agents interactively: a person opens a session with a coding agent, sends prompts for +hours, confirms tool calls and switches between read-only and autonomous work. AWP knows only +workflow runs; a runtime can run a session only by pretending it is a workflow with one step +(spec 6). This concept adds the smallest model for interactive use: an `AgentSession` kind next to +`WorkflowRun`, an opt-in on `Agent` with a ceiling for autonomy, and three autonomy levels. Many +details are deliberately left as open questions until a second runtime has experience with them. +It answers runtime feedback G62, G63, G73 and G82. + +## Motivation + +- **No execution form (G62).** A session has no task and no outputs, pauses when idle and resumes. + Budget, permissions and audit must still apply. A proof-of-concept runtime built its own session + object; another runtime would build a different one. +- **No ceiling for autonomy (G63).** Whether an agent may run without asking is today decided by + the platform, not by the agent's author. +- **Narrowing per session (G73, G82).** A person enables only some of the agent's tool sources or + picks a model from alternatives the author allows. + +## Specification + +### Changes to section 6 (kind `Agent`) + +"Runtimes MAY run a single agent as a workflow with one agent step, or interactively as an +`AgentSession` if the agent allows it." New optional field: + +| Field | Type | Description | +| ----- | ---- | ----------- | +| `sessions` | object | Whether the agent may run as an `AgentSession`. Absent: it may not. | +| `sessions.maxAutonomy` | string | Highest autonomy level: `readOnly`, `ask` (default) or `auto`. | +| `sessions.models` | list | Alternatives to `model` that a session may pick (model objects, spec 5.4.3). | + +### Autonomy levels + +| 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. | +| `auto` | Allowed actions run without confirmation. | + +Permissions decide first: no level allows an action that permissions deny. A level above +`maxAutonomy` or above the platform ceiling is rejected (AEP-0023 section 7.5.10). Confirmations are +decided outside the execution environment by an identity that may control the session (AEP-0023). +A confirmation is not an approval: rules that require an approval still require one. + +### New section 10.9 (kind `AgentSession`) + +```yaml +apiVersion: awp.agenticworkflowprotocol.org/v1alpha3 +kind: AgentSession +metadata: + generateName: security-review- + namespace: team-a +spec: + agentRef: + name: security-reviewer + autonomy: ask + toolSources: [code-scanner] + initialPrompt: Review the repository for injection flaws. +``` + +| Field | Type | Description | +| ----- | ---- | ----------- | +| `spec.agentRef` | object | An `Agent` in the same namespace; `version` and `digest` are assertions as in `WorkflowRun`. | +| `spec.autonomy` | string | Level the person selected; may change while the session runs. | +| `spec.model` | object | `model` or one of `sessions.models`; anything else is rejected. | +| `spec.toolSources` | list | Tool sources to enable (by `server` or `name`, spec 5.5.2). Absent: all. Never more than the agent declares. | +| `spec.initialPrompt` | string | First prompt. | +| `spec.paused`, `spec.stop` | boolean | Pause or end the session. | + +Rules: + +- The creator, taken from an authenticated source as for `WorkflowRun`, is the actor and may + control the session. A runtime MAY allow further identities and MUST document who. +- One session is one execution (spec 10.1): permissions, the agent's budget (summed across pauses) + and audit apply to the whole session. A prompt is user input and cannot change permissions, + policies or budgets. +- A runtime rejects a session before it starts if the agent has no `sessions`, or if model, tool + sources or autonomy are not allowed. +- `status` shows phase (`pending`, `ready`, `working`, `waiting`, `paused`, `finished`, `failed`, + `rejected`), the effective level, model and tool sources, and usage; never prompts, answers or + tool arguments. + +## Example + +```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 + tools: + - type: mcp + server: code-scanner + tools: [scan] + permissions: + default: deny + tools: + code-scanner.scan: + allow: true + budget: + maxCostUsd: 5 +``` + +A session can pick the large model, enable the scanner and work at `readOnly` or `ask`; selecting +`auto` is rejected. + +## Schema changes + +New root kind `AgentSession`; `sessions` on `$defs/AgentSpec`. Kubernetes binding: plural +`agentsessions`, namespaced, `status` subresource. + +## Conformance impact + +New profile `session`. Runtime tests: a level above `maxAutonomy` is rejected; a disabled tool +source is refused; a confirmation sent from inside the execution environment is not accepted. + +## Compatibility and migration + +Compatible: a new kind and an optional field. + +## Security considerations + +A confirmation protects only if it cannot come from inside the execution environment (AEP-0023). +Confirmations inside a sandbox protect against mistakes, not against a compromised engine; the +isolation class is the boundary for what stays inside. Prompts and repository content are +untrusted input (spec 12). + +## Privacy considerations + +Prompts and answers are personal data of the person who wrote them and may contain code and +secrets. Their retention is open question 3. + +## 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, and there is no autonomy level. +- **Autonomy only as platform configuration.** Rejected: the author should be able to forbid + autonomous use; the platform can only add limits. + +## Implementation status + +A proof-of-concept Kubernetes runtime has its own session object with modes `plan`, `ask` and +`auto` (allowed by a binding, not the manifest), tool source selection, model alternatives per +binding and tenant, pause on idle and one execution id. Tool calls are decided by a separate +container in the sandbox pod and confirmed through a console. Shown on a test installation with +real models. Not built: `maxAutonomy` in the manifest. + +## Open questions + +1. **Confirmation per action:** should a permission entry carry `confirm: always | never` (for + example "a push always asks", with only "allow once" offered)? How are shell commands mapped to + such actions (see the `actionGroups` amendment in AEP-0002)? +2. **Kinds of confirmation:** besides "allow once" and "refuse", a grant for the rest of the session? + It needs a determinable resource, otherwise it becomes a blanket grant. +3. **Governance without a workflow:** `dataPolicy`, `modelPolicy`, `environments`, `policies`, + `approval` and `audit` (with `contentRetention`) come from the workflow today. Put them on + `Agent`, attach `Policy` objects to agents (AEP-0021 B5), or use a platform-level session class? +4. **Questions of the agent:** human input (spec 5.8) requires `answerers`; in a session the person + is there. Does the question tool exist without `humanInput`? +5. **History after the end:** what is kept (history, workspace, diff), for how long, who may read it + (G85)? +6. **Event-started sessions (G86):** is the attested actor of AEP-0024 the creator? +7. **Naming:** `autonomy` is already used by `environments` with other values; rename the session + field (for example `mode`)? `AgentSession` or `Session`? +8. **Events:** which lifecycle and confirmation events, with which required data? + +## Decision + +Not decided. Number to be confirmed by the maintainer. + +## References + +- Runtime feedback G62, G63, G73, G82, G85, G86 ([runtime-feedback.md](../docs/runtime-feedback.md)). +- Spec `v1alpha3` sections 5.5.2, 5.8, 6, 7.5, 7.6, 10.1, 10.8. +- AEP-0019 (`WorkflowRun`), AEP-0023 (approvals outside the execution environment, ceilings), + AEP-0024, AEP-0027. diff --git a/aep/0027-agent-engine.md b/aep/0027-agent-engine.md new file mode 100644 index 0000000..eaf38ed --- /dev/null +++ b/aep/0027-agent-engine.md @@ -0,0 +1,170 @@ +# 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** | new profile `engine` | +| **Created** | 2026-11-23 | +| **Discussion** | issue to be opened | +| **Supersedes** | - | +| **Superseded-by** | - | + +## Summary + +An `Agent` assumes that the runtime runs the tool loop. Coding agents bring their own loop with file +editing, shell use and Git handling. This concept adds `agents[].engine`: which engine runs the +agent and from which repositories. AWP permissions, budgets and audit stay in force, and a runtime +without the engine rejects the manifest instead of running a different loop. Configuration from the +repository is not loaded unless the manifest allows it. Outputs, pushing and repositories chosen by +events are left as open questions. It answers runtime feedback G65 and G81 and part of G66 and G83. + +## Motivation + +- **Who runs the loop (G65).** A step "fix the critical findings" is best run by a coding agent. + The manifest cannot say so; a runtime that ignores an extension field runs its own loop and still + reports success. +- **Repository content as instructions (G81).** Repositories bring instruction files, skills, + commands and tool manager configuration that set environment variables. An engine loads them by + default, so a pull request can change what the agent does before any permission applies. + +## Specification + +### Changes to section 5.4 (agents) + +New optional field `engine` on inline agents and `Agent` manifests: + +| Field | Type | Description | +| ----- | ---- | ----------- | +| `engine.type` | string | The engine, a domain-prefixed value (`example.com/coding-agent`). A runtime that does not support it MUST reject the manifest. | +| `engine.workspace.repositories` | list | `url` (https, a fixed value), `ref`, `path`: cloned before the engine starts; the starting commit is recorded. | +| `engine.workspace.trustRepositoryConfig` | list | Kinds of repository configuration the engine may load: `instructions`, `skills`, `commands`, `toolchain`. Default: none. | + +### New section 5.4.5 (engine semantics) + +- Permissions (spec 7.5), budgets (spec 5.7) and audit apply to the engine as to any agent step; + model calls are metered outside the engine. Subagents of the engine share the step's permissions + and budget. +- In unattended executions an action is allowed or denied; there is nobody to ask. +- What leaves the execution environment (model and tool calls, network, credentials) is enforced + outside it (AEP-0023). For actions that stay inside, the boundary is the isolation class; the + engine's own permission system is an additional check. +- Clone credentials are workflow secrets (spec 7.9) and, under `security`, not visible to the engine. +- Repository configuration not listed in `trustRepositoryConfig` MUST NOT be loaded. Listed kinds + are untrusted input (spec 12) and cannot change permissions, budget or tools. + +## Example + +```yaml +apiVersion: awp.agenticworkflowprotocol.org/v1alpha3 +kind: Workflow +metadata: + name: security-scan +spec: + version: 0.2.0 + owner: + team: appsec + classification: internal + agents: + - id: scanner + isolation: sandbox + engine: + type: example.com/coding-agent + workspace: + repositories: + - url: https://git.example.com/app.git + ref: main + path: app + 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 and report the findings. Do not change files. + outputs: + - name: summary +``` + +## Schema changes + +`$defs/AgentEngine`; `engine` on `$defs/InlineAgent` and `$defs/AgentSpec`. + +## Conformance impact + +New profile `engine`. Runtime tests: an unknown engine is rejected; a repository instruction file is +not loaded; a subagent's model call counts against the step budget. + +## Compatibility and migration + +Compatible: a new optional field. Until it is applied, an `extensionRef` (AEP-0021 B3) is the +conforming way. + +## Security considerations + +An engine is a large program inside the execution environment; its decisions do not count as +enforcement (AEP-0023). Repository configuration is code and instructions from whoever can write to +the repository; the default "none" closes that path. + +## Privacy considerations + +Repositories may contain personal data; outputs follow 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 with `extensionRef`, but reviewers cannot compare + manifests across runtimes. +- **Engines as tools.** Rejected: the engine makes the model calls, so budgets, model policy and audit + must apply to it as to an agent. + +## Implementation status + +A proof-of-concept Kubernetes runtime runs agent steps with an open-source coding agent through an +extension field of this shape and disables project configuration and external skills. A security +scan workflow ran with it on a test installation, started by hand and by a CloudEvent. It produces +only `summary` and `diff` as outputs. + +## Open questions + +1. **Outputs (G66):** should the engine fill declared outputs through the completion mechanism of + AEP-0018, with types from AEP-0003, so that later steps can branch on them? +2. **Repositories from inputs or events (G66):** expression-enabled `url`? Then a clone credential + must be bound to a host or URL pattern, or a sender can redirect it. +3. **Push:** `engine.push` with branch and repository, `git.push` permission, outputs `branch` and + `commit`; and what pushing means in a session. +4. **Registry:** should this repository keep a registry of engine names? +5. **Tools:** must `tools` list everything the engine offers, or may built-in tools be covered by + permissions only? +6. **Failure:** does a refused tool call fail the step, or is it a tool error the agent can recover + from? + +## Decision + +Not decided. Number to be confirmed by the maintainer. + +## References + +- Runtime feedback G65, G66, G81, G83 ([runtime-feedback.md](../docs/runtime-feedback.md)). +- Spec `v1alpha3` sections 5.4, 5.7, 7.5, 7.9, 12. +- AEP-0003, AEP-0018, AEP-0021, AEP-0023, AEP-0026. diff --git a/docs/runtime-feedback.md b/docs/runtime-feedback.md index 6f7ea77..cabecc4 100644 --- a/docs/runtime-feedback.md +++ b/docs/runtime-feedback.md @@ -217,10 +217,10 @@ 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 | shown; the runtime treats a whole session as one execution for permissions, budget and audit | +| 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 | 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; 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 | +| 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 | partly shown: models, hosts and MCP servers outside the tenant ceiling reject; cost limits are still capped, unlike the revised proposal | diff --git a/spec/README.md b/spec/README.md index 6a42f8b..05ef510 100644 --- a/spec/README.md +++ b/spec/README.md @@ -47,6 +47,8 @@ and a Final Comment Period, and may still be moved to a later version or rejecte | [0023](../aep/0023-step-isolation.md) | Step isolation: network permissions, platform ceilings, credentials and approvals outside the execution environment | 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` and autonomy levels | 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 b0a79fb6fd907cdf3b13b97ac7088757a1d9ed59 Mon Sep 17 00:00:00 2001 From: Simon Lauger Date: Mon, 23 Nov 2026 20:27:17 +0100 Subject: [PATCH 2/2] docs(aep): open questions on session time limits and the engine runtime profile Signed-off-by: Simon Lauger --- aep/0026-interactive-execution.md | 2 ++ aep/0027-agent-engine.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/aep/0026-interactive-execution.md b/aep/0026-interactive-execution.md index fa74907..ee74317 100644 --- a/aep/0026-interactive-execution.md +++ b/aep/0026-interactive-execution.md @@ -201,6 +201,8 @@ real models. Not built: `maxAutonomy` in the manifest. 7. **Naming:** `autonomy` is already used by `environments` with other values; rename the session field (for example `mode`)? `AgentSession` or `Session`? 8. **Events:** which lifecycle and confirmation events, with which required data? +9. **Time limits:** `sessions.idleTimeout` (pause after inactivity) and `sessions.maxDuration` (end + after active time) in the manifest, or runtime configuration? ## Decision diff --git a/aep/0027-agent-engine.md b/aep/0027-agent-engine.md index eaf38ed..727c6ac 100644 --- a/aep/0027-agent-engine.md +++ b/aep/0027-agent-engine.md @@ -158,6 +158,8 @@ only `summary` and `diff` as outputs. permissions only? 6. **Failure:** does a refused tool call fail the step, or is it a tool error the agent can recover from? +7. **Runtime profile:** should the manifest name a runtime-defined profile for image and resources + (`engine.runtimeProfile`), or is that binding data only? ## Decision