# Operating an agent fleet: register, metering, kill switch and review

> Run many agents after the pilots, with cost per agent, tool lineage, a kill switch with clear authority, and a weekly review that measures the process.

- Course: Orchestrate, Unit 23 · Joule and the AI platform: the architect's view
- Page: https://erpfde.com/topics/operating-an-agent-fleet/
- Updated: 2026-11-29
- Reading time: Foundational 9 min, Deep 38 min

Independent learning resource. Not affiliated with, sponsored by or endorsed by SAP SE. SAP and other SAP products mentioned are trademarks of SAP SE in Germany and other countries.

## Foundational layer

### The 60-second version

A pilot has one agent and a team that watches it every day. A year later a company has a dozen agents, built in different places, owned by different teams, and nobody watches all of them. That is a **fleet**, and it needs operating like any other production service.

Operating a fleet comes down to five habits:

1. **One register.** Every agent has an entry: what it is for, who owns it, which tools and data it touches.
2. **A meter.** You know what each agent costs this month, and what it costs per useful result.
3. **Lineage.** When an API, a tool or a role changes, you can list the agents it affects before the change, not after.
4. **A kill switch.** Named people can stop one agent in minutes, everywhere it runs, and a different person decides when it comes back.
5. **A weekly review.** A short meeting looks at every agent and decides: keep, watch, fix, retire.

The test of the whole thing is not whether the agents run. It is whether the **business process** the agent was meant to change has moved.

### Why it matters to the business

Three things go wrong when nobody operates the fleet.

- **Cost surprises.** Agents are billed per step, per action or per token. One agent stuck in a loop can burn a week's budget in an hour. Without a meter per agent, finance sees one large AI line and can't say which team caused it.
- **Silent breakage.** An agent reads the sales order API. Integration replaces a tool, or security removes a permission from a role. The agent starts failing or, worse, giving wrong advice. Without lineage, nobody knew the agent depended on it.
- **Agents nobody owns.** The person who built a helper leaves. It keeps its credentials and keeps running, or stops being used but keeps its access. Each one is an open door.

At the fictional pump maker Calder Pumpworks, the invoice triage agent `AGT_INV_TRIAGE` helps accounts payable with blocked supplier invoices in procure-to-pay. Its own numbers looked fine for months. The question finance actually asks is different: are invoices released faster than before? That is a process number, and only a review that looks at the process can answer it.

### How SAP does it

As of November 2026, SAP's pieces for operating agents sit in a few products. None of them does the whole job alone, and several are described as planned or in preview.

| Need | SAP offering, as stated on SAP's pages | Status on 2026-11-29 |
| --- | --- | --- |
| Register and lifecycle | **SAP AI Agent Hub**, built on SAP LeanIX: fact sheets, verification, suspend or revoke, retirement steps ([SAP Architecture Center](https://architecture.learning.sap.com/docs/ref-arch/jfhsd9)) | No GA label on the page; governance assistant in preview |
| Agent telemetry | **SAP Cloud ALM** receives session telemetry from SAP-managed agents, with dashboards for evaluation rates, errors, session volumes and performance ([same page](https://architecture.learning.sap.com/docs/ref-arch/jfhsd9)) | Named for SAP-managed agents |
| Consumption and cost | **SAP for Me** shows AI Unit consumption near real time and lets you deactivate agents or features ([SAP AI pricing](https://www.sap.com/products/artificial-intelligence/pricing.html)) | Available |
| Process impact | **SAP Signavio agent mining**: how agents move through process steps, effect on cycle time and exception rates, cost per execution ([SAP Architecture Center](https://architecture.learning.sap.com/docs/ref-arch/3c8d50)) | Planned for Joule Studio 2.0 agents, not GA |
| Stopping a third-party caller | **SAP Agent Gateway** access list per consumer, changeable without onboarding again ([Architecture Center news, 27 October 2026](https://architecture.learning.sap.com/news/2026/10/27/a2a-agent-gateway-interoperability)) | Inbound A2A GA since October 2026 |

What SAP's pages don't give you: a governance board, a review cadence, a rule for who may pull a kill switch, or a cost per business outcome. Those are your operating model, and this topic shows one.

### The operating rhythm on one page

| Cadence | Meeting | Who | Decides | Input |
| --- | --- | --- | --- | --- |
| Any time | Kill switch | Agent owner, Agent Manager or on-call | Stop one agent now | An alert, a complaint, a spike |
| Weekly, 30 min | Trust review | Agent Managers, owners of flagged agents | Keep, watch, fix, retire, restore | Meter, lineage, override rate, kill log |
| Monthly | Governance board | Enterprise architect (chair), security, process owners, finance | New agents in, risk tier, budgets | Intake requests, last month's reviews |
| Quarterly | Portfolio review | CIO and process owners | Scale, replace or stop an agent family | Process KPIs before and after |

> **Note** **For functional consultants.** Agents become part of the systems you change. When you change a role, retire an API or alter a process step, ask the platform team for the lineage report first: which agents call it, and who owns them. Their retest belongs in your test plan, the same way an interface does. And when you define the success of an agent, define it as a process number you already know (hours from block to release, first-time-right rate), not as the agent's own accuracy.

### Questions to ask

1. Can you show me, for last month, what each agent cost and what that cost per accepted result was?
2. If we change this API or this role next week, which agents break, and who will retest them?
3. Who may stop an agent, how fast does it stop everywhere it runs, and who decides it comes back?
4. Which agents have not run in the last quarter, and why do they still have access?
5. For each agent, which process KPI was it meant to move, what was the baseline, and has it moved?
6. How often do people edit or reject the agent's drafts, and who looks at that number?
7. Which of SAP's operating features we're counting on are generally available, and which are planned or preview?

### Common misconceptions

- **"The register is a one-time inventory."** It goes stale the first week. Lineage from real traces keeps it honest: what the agent actually called, not what someone wrote down.
- **"High acceptance means the agent works."** People can accept drafts that don't change the outcome. An agent can be accepted 80% of the time while the process takes just as long, because the bottleneck is elsewhere.
- **"A kill switch is a button in one product."** An agent can be reached through its own runtime, a gateway and an SAP user. Stopping it means closing each of those, and checking that they're closed.
- **"Retiring an agent means switching it off."** Retirement also removes its credentials and integrations, hands over ownership and keeps the records. Half-retired agents are a common audit finding.
- **"Cost per agent is a finance problem."** The useful number is cost per accepted result, and only the team running the agent can produce it.

### Key terms

- **Agent fleet:** all the agents a company runs in production, across every platform.
- **Agent register:** the list of agents with intent, owner, tools, data touched, verification and lifecycle state.
- **Metering:** counting the steps, actions or tokens each agent uses and turning them into cost.
- **Cost per outcome:** an agent's cost divided by the useful results it produced, such as accepted drafts.
- **Lineage:** the record of which tools, APIs and roles each agent actually uses, taken from its traces.
- **Impact analysis:** using lineage to list the agents a planned change will affect.
- **Kill switch:** a fast, logged way for named people to stop one agent everywhere it runs.
- **Override rate:** the share of an agent's drafts that people edit or reject.
- **Trust review:** a short weekly meeting that gives each agent a verdict from its numbers.

### Check yourself

1. What turns a set of agents into a fleet that needs operating?
   - A. Using models from more than one provider across the company's agents
   - B. Many agents, many owners, and nobody watching all of them daily
   - C. Moving the agents from a trial account to a paid one
   - D. Running the agents in Joule instead of on BTP

   Answer: B. A pilot has a team watching one agent. A fleet has a dozen agents built in different places and owned by different teams, so it needs a register, a meter and a review rhythm.

2. Finance sees one large AI line on the bill and asks which team caused it. What was missing?
   - A. A larger AI Unit purchase at the start of the contract year
   - B. A rule that only SAP-delivered agents may run
   - C. A meter that turns steps and tokens into cost per agent
   - D. A monthly governance board meeting

   Answer: C. Agents are billed per step, action or token. Without counting usage per agent, a loop in one agent shows up only as a larger total that nobody can explain.

3. Security plans to remove a permission from a role next week. What should the platform team produce first?
   - A. A new verification for every agent in the register
   - B. A lineage report listing the agents that use that role
   - C. An AI Unit forecast for the next quarter
   - D. A Signavio model of the whole procure-to-pay process today

   Answer: B. Lineage shows which agents depend on a role, API or tool. With it the owners retest before the change instead of discovering broken agents after it.

4. Who should decide that a stopped agent comes back?
   - A. The person who stopped it, since they know why
   - B. Anyone on the on-call rota, to keep it fast
   - C. The agent's own monitoring rule, once errors drop
   - D. A second Agent Manager, with a root cause

   Answer: D. Stopping must be fast, so several people may do it. Restoring needs a cause and a second person, so an agent doesn't come back before anyone knows what went wrong.

5. An agent's drafts are accepted 80% of the time, but blocked orders wait as long as before. What does that tell a leader?
   - A. The agent needs a bigger model to raise acceptance further
   - B. The agent isn't the bottleneck; the process hasn't moved
   - C. The acceptance figure must be wrong and should be ignored
   - D. The agent is ready to scale to every sales organization

   Answer: B. Agent metrics and process metrics answer different questions. If the KPI the agent was meant to move is flat, the business case isn't met, however good the drafts are.

6. An agent's builder left the company and nobody has used the agent for three months. What should the review decide?
   - A. Keep it, since it costs nothing while idle
   - B. Hand it to the next person who asks for it
   - C. Retire it: revoke access, keep the records
   - D. Switch it off and leave its access in place for later

   Answer: C. An unused agent with live access is an open door. Retirement is a set of steps, not only switching off, and the records stay for audit.

7. Which of these does SAP describe as planned, not generally available, on 2026-11-29?
   - A. Inbound A2A calls from third-party agents through SAP Agent Gateway
   - B. AI Unit consumption shown in SAP for Me
   - C. Deactivating agents in SAP for Me
   - D. SAP Signavio agent mining for Joule Studio 2.0 agents

   Answer: D. SAP's Architecture Center page on agent mining says it describes a planned model not yet GA. Inbound A2A went GA in October 2026, and SAP for Me shows consumption today.

## Deep layer

### Mental model

Run agents the way you run interfaces and batch jobs, with one extra fact: an agent decides at run time which tools to call, so its dependencies are only partly known in advance.

That gives three records and one loop:

- **What it should do:** the register entry. Intent, owner, declared tools, APIs, role, budget, expected cadence, the KPI it is meant to move.
- **What it did:** traces. Every run as a tree of model calls and tool calls, with token counts and the outcome.
- **What it changed:** process data. The KPI before and after, for documents the agent touched and documents it didn't.

The loop is the weekly review: compare the three, give each agent a verdict, and act. The kill switch is the exception path when the loop is too slow.

The register topic, [AI Agent Hub and agent governance](https://erpfde.com/topics/ai-agent-hub-and-governance/), covers how an agent gets into the register and gets verified. This topic starts where that one ends: the agents are verified and running, and now you have to keep them honest.

### How it works

```mermaid
flowchart LR
  R[Register<br/>intent, owner,<br/>tools, budget] --> V[Weekly<br/>trust review]
  T[Traces<br/>model and tool calls,<br/>tokens, outcome] --> M[Meter]
  T --> L[Lineage]
  M --> V
  L --> V
  P[Process data<br/>KPI before and after] --> V
  V -->|keep, watch,<br/>fix, retire| R
  A[Alert or spike] --> K[Kill switch]
  K --> E[Enforcement points:<br/>runtime, gateway,<br/>SAP role]
  K --> V
```

#### The register entry an operator needs

The register topic's entry answers "may this agent run?". Operating needs a few more fields:

| Field | Why operations needs it | Calder example |
| --- | --- | --- |
| Declared tools and APIs | The baseline lineage is compared with | `AGT_ORDER_EXC`: `list_sales_orders`, `get_sales_order`, `draft_next_step` |
| Technical role | The SAP side of the kill switch and of impact analysis | `ZT_AGENT_INVOICE_TRIAGE` |
| Budget per month | The meter's threshold | `AGT_SUPPLY_WATCH`: 35.00 USD |
| Expected cadence | Tells "idle" from "monthly" | `AGT_CLOSE_ACCR` runs on close days only: 31 days |
| Outcome | What counts as a useful result | An accepted draft |
| Process KPI | What the agent is meant to move | Median hours from invoice block to release |

#### Metering: from steps and tokens to cost per outcome

Agents are billed in different units depending on where they run, as of November 2026:

- **Joule agents** are priced in AI Units per action, tracked at the action level; SAP-delivered agents in 2026 are at 0.02 AI Units per action ([SAP AI pricing](https://www.sap.com/products/artificial-intelligence/pricing.html)). SAP Learning describes agent usage in steps, at 0.005 AI Units per step for the Basic category, which it says customer-built agents generally fall into ([SAP Learning](https://learning.sap.com/courses/introducing-joule/understanding-the-commercial-model)). The pricing page also says custom-built agents run free in the Joule Studio runtime through the end of 2026 and are then billed on resource consumption through BTPEA. The two pages don't use the same unit, so confirm with SAP how your custom agents will be metered in 2027, and meter them yourself now as a shadow price. What changes after the free runtime is followed on the radar page [pricing custom agents after the free Joule Studio runtime](https://erpfde.com/topics/pricing-custom-agents-after-the-free-runtime/).
- **Agents on your own BTP runtime** pay for model tokens through the generative AI hub, plus the runtime. Token pricing is covered in [token economics](https://erpfde.com/topics/token-economics/) and grouping cost by use case in [batch and observability in the generative AI hub](https://erpfde.com/topics/batch-and-observability-in-the-generative-ai-hub/).
- **Agents on another platform** (Copilot Studio, Bedrock, Agentforce) are billed by that platform, in its own unit.

So a fleet meter normalizes everything to money and divides by outcomes. Cost per accepted draft is comparable across platforms; AI Units and tokens aren't.

Watch two shapes, not only the total:

- **Budget:** the month's cost against the agent's budget.
- **Spike:** a day whose steps are several times the median day. A loop shows up here hours before the budget line moves.

SAP for Me shows AI Unit consumption near real time and lets you deactivate agents or features there when you approach your purchased volume ([SAP AI pricing](https://www.sap.com/products/artificial-intelligence/pricing.html)). That is a coarse control at the account level; the per-agent meter is yours.

#### Tracing: one shape for every platform

Each run should produce a trace with an agent span, model-call spans and tool-call spans. OpenTelemetry's GenAI conventions name these operations `invoke_agent`, `chat` and `execute_tool`, and define attributes such as `gen_ai.agent.id`, `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens` and `gen_ai.tool.name` ([OpenTelemetry agent spans](https://raw.githubusercontent.com/open-telemetry/semantic-conventions-genai/2e994c6d59a93bb4fc1752c5378eedb9b8e14d6b/docs/gen-ai/gen-ai-agent-spans.md)). As of November 2026 these conventions are marked **Development** and have moved to their own repository ([OpenTelemetry GenAI spans](https://raw.githubusercontent.com/open-telemetry/semantic-conventions-genai/main/docs/gen-ai/gen-ai-spans.md)), so names can still change; pin the version you emit.

Why it matters for operations: SAP's planned Signavio agent mining relies on OpenTelemetry traces from Joule Studio 2.0 agents ([SAP Architecture Center](https://architecture.learning.sap.com/docs/ref-arch/3c8d50)), and SAP Cloud ALM's raw data APIs for metrics, logs and traces are based on OpenTelemetry ([SAP Learning](https://learning.sap.com/courses/operating-sap-business-ai-platform/explaining-central-observability-tools_c3e8a8ad-76e5-43ec-a7b9-0705532a44fd)). If your own agents emit the same shape, the meter, lineage and mining can read them all. How to instrument one AI app is in [observability for AI systems](https://erpfde.com/topics/observability-for-ai-systems/); where BTP workloads send their telemetry is in [observability on BTP](https://erpfde.com/topics/btp-observability/).

> **Warning** Traces can contain prompts, tool arguments and results, which means business data and personal data. SAP's agent mining page warns that traces may contain sensitive data. Capture content only where you need it, and give the trace store the same access rules as the data.

#### Lineage and impact analysis

Lineage compares the register's declared tools with the tools the traces show:

- **Observed but not declared:** the agent calls something nobody reviewed. That is a finding, even for a read.
- **Declared but never called:** the register is wider than needed; the role may be too.

Impact analysis turns lineage around: given a change (a tool version, an API's communication arrangement, a role's authorizations), list the agents that use it and their owners. Run it in the change process, the way you would for an interface.

#### The kill switch

A kill switch has three parts, and most designs only build the first.

1. **Authority.** Who may pull it (fast: the owner, an Agent Manager, on-call) and who may restore it (slow: an Agent Manager other than the person who pulled it, with a root cause).
2. **Enforcement points.** Every way the agent can act. For a Joule Studio agent: its production deployment and its verification status. For a third-party agent calling SAP agents: its entry on the Agent Gateway access list, which you can change without onboarding again ([Architecture Center news](https://architecture.learning.sap.com/news/2026/10/27/a2a-agent-gateway-interoperability)). For an agent on your own runtime: the gateway key and the app. For all of them: the SAP user or role the agent uses.
3. **A log.** Append-only, including refused attempts.

Stopping an agent must leave the manual process working: the worklist the agent used to draft from is still there for people. For one agent at go-live, [hypercare and drift](https://erpfde.com/topics/hypercare-and-drift-after-go-live/) covers the switch and the manual fallback. A fleet adds the authority rules and the number of doors to close.

SAP's AI Agent Hub page lists "the ability to suspend or revoke the agent" as part of the Enforce stage ([SAP Architecture Center](https://architecture.learning.sap.com/docs/ref-arch/jfhsd9)). The pages read don't say how a status change in the hub reaches each runtime or how fast, so test it: pull the switch in a test tenant and time how long each enforcement point takes to refuse.

#### The weekly trust review

One short meeting, one table, one verdict per agent:

| Verdict | Course rule | Action |
| --- | --- | --- |
| KILLED | Switch pulled and not restored | Root cause, then restore or retire |
| RETIRE | No run for more than 3 times its cadence, at least 30 days | Revoke credentials and integrations, hand over, keep records |
| FIX | Calls tools outside its register entry | Owner declares and re-verifies, or removes the call |
| WATCH | Override rate above 25%, errors above 5%, or over budget | Owner brings a cause next week |
| KEEP | None of the above | Nothing |

The cadence matters. A fixed "idle for 14 days" rule would retire Calder's accruals agent in the middle of every month.

#### Measuring the process, not only the agent

The review's last column is the one a sponsor reads: has the process KPI moved? Compare the month before the agent with the month after, and inside the month, documents the agent touched with documents it didn't. If both are flat, the agent isn't the constraint, however good its acceptance rate. Unit 12's [process mining topic](https://erpfde.com/topics/process-mining-to-find-ai-opportunities/) shows how to find where the time actually goes.

### Build it yourself

You will operate Calder's fleet for one week: meter November's runs, check lineage and two planned changes, work the kill switch with its authority rules, read the process KPIs, and write the weekly trust review. Everything runs on synthetic data, so no account is needed.

**Before you start:** complete [Set up your computer for this course](https://erpfde.com/topics/set-up-your-computer/) and [Set up for Unit 23](https://erpfde.com/topics/set-up-for-unit-23/). This script needs no account and no network.

```mermaid
flowchart LR
  I[--init] --> F[unit23/fleet/<br/>register, runs,<br/>changes, process events]
  F --> M[meter]
  F --> L[lineage]
  F --> K[kill, restore, gate]
  F --> P[process]
  M --> R[review]
  L --> R
  K --> R
  R --> D[trust_review_<br/>2026-11-30.md]
```

> **Note** New words in this walkthrough:
> - **JSON / JSONL:** plain text formats for structured data. A `.jsonl` file holds one JSON record per line; `runs.jsonl` has one line per agent run.
> - **Trace and span:** a trace is one agent run; each span is one step inside it (a model call or a tool call).
> - **Exit code:** a number a program returns when it ends. This script returns 2 when something needs action, so a scheduler can alert on it.
> - **Seed:** a fixed starting number for the random generator, so your sample data matches this page.

#### What you need

- Your course folder `orchestrate-course` with `.venv`.
- About 35 minutes.
- Cost: free. No account, no network, no model calls.

#### Step 1: Open your course folder and turn on the virtual environment

1. Open VS Code, choose **File > Open Folder**, and open `orchestrate-course`.
2. Open a terminal: **Terminal > New Terminal**.
3. If the prompt doesn't start with `(.venv)`, turn it on:

   - **Windows (PowerShell):**

     ```powershell
     .venv\Scripts\Activate.ps1
     ```

   - **macOS / Linux:**

     ```bash
     source .venv/bin/activate
     ```

4. Make sure the `unit23` folder exists. The command does nothing if it is already there.

   - **Windows (PowerShell):**

     ```powershell
     New-Item -ItemType Directory -Force unit23
     ```

   - **macOS / Linux:**

     ```bash
     mkdir -p unit23
     ```

#### Step 2: Create the script

1. In VS Code, create the file `unit23/fleet_ops.py`, paste the code below, and save.

```python
"""Operate Calder's agent fleet: meter, lineage, kill switch, trust review.

Course lab for Unit 23. Built-in modules only. Seed 42. All data is made up.
Run:  python unit23/fleet_ops.py --init      (writes unit23/fleet/)
      python unit23/fleet_ops.py meter
      python unit23/fleet_ops.py lineage [--change CHG-01]
      python unit23/fleet_ops.py gate AGT_SUPPLY_WATCH
      python unit23/fleet_ops.py kill AGT_ID --by 00100288 --reason "..."
      python unit23/fleet_ops.py restore AGT_ID --by 00100290 --cause "..."
      python unit23/fleet_ops.py process
      python unit23/fleet_ops.py review
"""
import argparse
import json
import random
import statistics
import sys
from datetime import date, datetime, timedelta
from pathlib import Path

HERE = Path(__file__).resolve().parent / "fleet"
LAB_DATE = date(2026, 11, 30)          # Monday: the weekly trust review
MONTH_START = date(2026, 11, 1)
AI_UNITS_PER_STEP = 0.005              # SAP Learning: customer-built agents, Basic
USD_PER_AI_UNIT = 8.00                 # course price, not SAP's
USD_PER_M_IN, USD_PER_M_OUT = 2.00, 8.00   # course token prices
STEP_CAP = 20

# ---------------------------------------------------------------- sample data
REGISTER = [
    {"id": "AGT_INV_TRIAGE", "name": "Invoice triage agent", "home": "joule-studio",
     "owner": "00100244", "intent": "Propose next step for blocked supplier invoices in CP10",
     "tools": ["supplier_invoice_get", "po_get", "po_history_get", "propose_action"],
     "apis": ["API_SUPPLIERINVOICE_PROCESS_SRV", "API_PURCHASEORDER_PROCESS_SRV"],
     "role": "ZT_AGENT_INVOICE_TRIAGE", "cadence_days": 7, "budget_usd": 90.00,
     "kpi": "invoice_block_hours", "outcome": "accepted draft"},
    {"id": "AGT_ORDER_EXC", "name": "Order exceptions agent", "home": "joule-studio",
     "owner": "00100296", "intent": "Draft next step for blocked sales orders in CPUS",
     "tools": ["list_sales_orders", "get_sales_order", "draft_next_step"],
     "apis": ["API_SALES_ORDER_SRV"], "role": "ZT_AGENT_ORDER_EXC",
     "cadence_days": 7, "budget_usd": 140.00,
     "kpi": "order_block_hours", "outcome": "accepted draft"},
    {"id": "AGT_SUPPLY_WATCH", "name": "Supply watch agent", "home": "btp-custom",
     "owner": "00100153", "intent": "Flag MRP exceptions at CP11 and draft PO date changes",
     "tools": ["mrp_exceptions_get", "po_get", "po_date_change_draft"],
     "apis": ["API_PURCHASEORDER_PROCESS_SRV"], "role": "ZT_AGENT_SUPPLY_WATCH",
     "cadence_days": 7, "budget_usd": 35.00,
     "kpi": None, "outcome": "accepted draft"},
    {"id": "sales-quote-helper", "name": "Sales quote helper", "home": "copilot-studio",
     "owner": "00100266", "intent": "Draft spare-part quotations for inside sales",
     "tools": ["get_sales_order", "create_sales_quotation_draft"],
     "apis": ["API_SALES_ORDER_SRV", "API_SALES_QUOTATION_SRV"], "role": "ZT_AGENT_QUOTE",
     "cadence_days": 7, "budget_usd": 15.00, "usd_per_run": 0.04,
     "kpi": None, "outcome": "accepted draft"},
    {"id": "AGT_CLOSE_ACCR", "name": "Accruals agent", "home": "joule-studio",
     "owner": "00100310", "intent": "Propose month-end accruals for CP10",
     "tools": ["po_history_get", "propose_accrual"],
     "apis": ["API_PURCHASEORDER_PROCESS_SRV"], "role": "ZT_AGENT_CLOSE",
     "cadence_days": 31, "budget_usd": 15.00, "kpi": None, "outcome": "accepted draft"},
    {"id": "AGT_CERT_LOOKUP", "name": "Test certificate lookup", "home": "joule-studio",
     "owner": "00100314", "intent": "Answer questions about pump test certificates",
     "tools": ["cert_archive_search"], "apis": ["ZCALDER_CERT"], "role": "ZT_AGENT_CERT",
     "cadence_days": 7, "budget_usd": 5.00, "last_run": "2026-09-02",
     "kpi": None, "outcome": "answer"},
]

PEOPLE = {
    "agent_managers": ["00100290", "00100292"],
    "on_call": ["00100288"],
    "kill_may": "owner, Agent Manager or on-call",
    "restore_may": "Agent Manager who did not pull the switch, with a root cause",
}

CHANGES = [
    {"id": "CHG-01", "kind": "tool", "target": "get_sales_order",
     "text": "calder-salesorders MCP server replaces get_sales_order v1 with v2 on 2026-12-08"},
    {"id": "CHG-02", "kind": "api", "target": "API_PURCHASEORDER_PROCESS_SRV",
     "text": "Purchase order API moves to a new communication arrangement on 2026-12-15"},
    {"id": "CHG-03", "kind": "role", "target": "ZT_AGENT_INVOICE_TRIAGE",
     "text": "Role loses display of purchase order history (security redesign)"},
]

PLAN = {  # runs in November, mean steps, model, tokens per model call
    "AGT_INV_TRIAGE": (300, 6, "gpt-5.4", 2400, 180),
    "AGT_ORDER_EXC": (600, 5, "gpt-5.4", 2100, 160),
    "AGT_SUPPLY_WATCH": (440, 14, "gpt-5.4", 3200, 220),
    "sales-quote-helper": (120, 4, "copilot", 1800, 300),
    "AGT_CLOSE_ACCR": (36, 8, "gpt-5.4", 2600, 260),
}


def workdays(start, end):
    d = start
    while d <= end:
        if d.weekday() < 5:
            yield d
        d += timedelta(days=1)


def make_runs(rng):
    runs = []
    days = list(workdays(MONTH_START, date(2026, 11, 27)))
    n = 0
    for agent_id, (count, steps, model, tin, tout) in PLAN.items():
        reg = next(a for a in REGISTER if a["id"] == agent_id)
        for i in range(count):
            if agent_id == "AGT_CLOSE_ACCR":
                day = days[i % 3]                     # workdays 1 to 3
            else:
                day = days[i % len(days)]
            start = datetime(day.year, day.month, day.day, 8, 0) + timedelta(
                minutes=rng.randint(0, 540))
            k = max(2, steps + rng.randint(-2, 2))
            spans = []
            for s in range(k):
                if s % 2 == 0:
                    spans.append({"gen_ai.operation.name": "chat",
                                  "gen_ai.request.model": model,
                                  "gen_ai.usage.input_tokens": tin + rng.randint(-300, 300),
                                  "gen_ai.usage.output_tokens": tout + rng.randint(-40, 40)})
                else:
                    tool = reg["tools"][(s // 2) % len(reg["tools"])]
                    if agent_id == "sales-quote-helper" and rng.random() < 0.15:
                        tool = "get_customer_credit"      # not in the register
                    spans.append({"gen_ai.operation.name": "execute_tool",
                                  "gen_ai.tool.name": tool})
            r = rng.random()
            outcome = ("accepted" if r < 0.78 else "edited" if r < 0.90
                       else "rejected" if r < 0.97 else "error")
            if agent_id == "sales-quote-helper":
                outcome = "accepted" if r < 0.55 else "edited" if r < 0.70 else "rejected"
            n += 1
            runs.append({"trace_id": f"{n:032x}", "gen_ai.agent.id": agent_id,
                         "start": start.isoformat(timespec="minutes"),
                         "user": reg["owner"], "outcome": outcome, "spans": spans})
    # The loop: AGT_SUPPLY_WATCH on 2026-11-24 from 09:00, 60 runs at the step cap
    for i in range(60):
        n += 1
        start = datetime(2026, 11, 24, 9, 0) + timedelta(minutes=i)
        spans = []
        for s in range(STEP_CAP):
            if s % 2 == 0:
                spans.append({"gen_ai.operation.name": "chat", "gen_ai.request.model": "gpt-5.4",
                              "gen_ai.usage.input_tokens": 9000 + 400 * s,
                              "gen_ai.usage.output_tokens": 220})
            else:
                spans.append({"gen_ai.operation.name": "execute_tool",
                              "gen_ai.tool.name": "mrp_exceptions_get"})
        runs.append({"trace_id": f"{n:032x}", "gen_ai.agent.id": "AGT_SUPPLY_WATCH",
                     "start": start.isoformat(timespec="minutes"), "user": "00100153",
                     "outcome": "error", "spans": spans})
    runs.sort(key=lambda x: x["start"])
    return runs


def make_process(rng):
    """Blocked documents in October (no agents) and November (agents live)."""
    ev = []
    for proc, base, with_agent in (("invoice_block_hours", 31.0, 17.0),
                                   ("order_block_hours", 26.0, 25.0)):
        for month, count in (("2026-10", 120), ("2026-11", 130)):
            for i in range(count):
                touched = month == "2026-11" and rng.random() < 0.7
                mean = with_agent if touched else base
                ev.append({"kpi": proc, "month": month, "agent_touched": touched,
                           "hours": round(max(1.0, rng.gauss(mean, mean * 0.35)), 1)})
    return ev


def init():
    rng = random.Random(42)
    HERE.mkdir(parents=True, exist_ok=True)
    (HERE / "register.json").write_text(json.dumps(REGISTER, indent=2))
    (HERE / "people.json").write_text(json.dumps(PEOPLE, indent=2))
    (HERE / "changes.json").write_text(json.dumps(CHANGES, indent=2))
    with open(HERE / "runs.jsonl", "w") as f:
        for r in make_runs(rng):
            f.write(json.dumps(r) + "\n")
    (HERE / "process_events.json").write_text(json.dumps(make_process(rng)))
    ks = {"AGT_SUPPLY_WATCH": {"state": "KILLED", "at": "2026-11-24T10:14",
                               "by": "00100288", "reason": "Runs at the step cap since 09:00"}}
    (HERE / "kill_switches.json").write_text(json.dumps(ks, indent=2))
    (HERE / "kill_log.jsonl").write_text(json.dumps(
        {"at": "2026-11-24T10:14", "agent": "AGT_SUPPLY_WATCH", "action": "kill",
         "by": "00100288", "result": "OK", "reason": "Runs at the step cap since 09:00"}) + "\n")
    print(f"Wrote register, people, changes, runs, process events and kill switches to {HERE}")


# ---------------------------------------------------------------- helpers
def load():
    if not (HERE / "register.json").exists():
        sys.exit("No fleet files. Run: python unit23/fleet_ops.py --init")
    reg = json.loads((HERE / "register.json").read_text())
    runs = [json.loads(l) for l in open(HERE / "runs.jsonl")]
    return reg, runs


def meter_rows(reg, runs):
    rows = []
    for a in reg:
        mine = [r for r in runs if r["gen_ai.agent.id"] == a["id"]]
        steps = sum(len(r["spans"]) for r in mine)
        tin = sum(s.get("gen_ai.usage.input_tokens", 0) for r in mine for s in r["spans"])
        tout = sum(s.get("gen_ai.usage.output_tokens", 0) for r in mine for s in r["spans"])
        units = 0.0
        if a["home"] == "joule-studio":
            units = steps * AI_UNITS_PER_STEP
            usd = units * USD_PER_AI_UNIT
        elif a["home"] == "btp-custom":
            usd = tin / 1e6 * USD_PER_M_IN + tout / 1e6 * USD_PER_M_OUT
        else:
            usd = len(mine) * a.get("usd_per_run", 0)
        good = sum(1 for r in mine if r["outcome"] == "accepted")
        per_day = {}
        for r in mine:
            d = r["start"][:10]
            per_day[d] = per_day.get(d, 0) + len(r["spans"])
        spike = None
        if per_day:
            med = statistics.median(per_day.values())
            top = max(per_day, key=per_day.get)
            if per_day[top] > 3 * med:
                spike = f"{top}: {per_day[top]} steps vs median {med:.0f}"
        rows.append({"id": a["id"], "runs": len(mine), "steps": steps, "tin": tin, "tout": tout,
                     "units": units, "usd": usd, "good": good, "budget": a["budget_usd"],
                     "per_good": usd / good if good else None, "spike": spike})
    return rows


def meter(reg, runs):
    print("November 2026, 1 to 27 (synthetic)")
    print(f"{'Agent':<19}{'Runs':>6}{'Steps':>7}{'AI Units':>10}{'USD':>9}"
          f"{'Budget':>8}{'Accepted':>9}{'USD/acc':>9}")
    total = 0
    for m in meter_rows(reg, runs):
        total += m["usd"]
        pg = f"{m['per_good']:.3f}" if m["per_good"] else "-"
        flag = "  OVER BUDGET" if m["usd"] > m["budget"] else ""
        print(f"{m['id']:<19}{m['runs']:>6}{m['steps']:>7}{m['units']:>10.2f}{m['usd']:>9.2f}"
              f"{m['budget']:>8.2f}{m['good']:>9}{pg:>9}{flag}")
        if m["spike"]:
            print(f"{'':<19}SPIKE {m['spike']}")
    print(f"{'Fleet':<19}{'':>32}{total:>9.2f}")


def observed_tools(runs, agent_id):
    out = {}
    for r in runs:
        if r["gen_ai.agent.id"] != agent_id:
            continue
        for s in r["spans"]:
            t = s.get("gen_ai.tool.name")
            if t:
                out[t] = out.get(t, 0) + 1
    return out


def lineage(reg, runs, change_id=None):
    if change_id:
        ch = next((c for c in json.loads((HERE / "changes.json").read_text())
                   if c["id"] == change_id), None)
        if not ch:
            sys.exit(f"Unknown change {change_id}")
        print(f"{ch['id']}: {ch['text']}")
        hit = 0
        for a in reg:
            obs = observed_tools(runs, a["id"])
            if ch["kind"] == "tool":
                uses = ch["target"] in a["tools"] or ch["target"] in obs
                n = obs.get(ch["target"], 0)
            elif ch["kind"] == "api":
                uses, n = ch["target"] in a["apis"], None
            else:
                uses, n = ch["target"] == a["role"], None
            if uses:
                hit += 1
                calls = f", {n} calls in November" if n is not None else ""
                print(f"  AFFECTED {a['id']} (owner {a['owner']}{calls})")
        print(f"  {hit} agent(s) to retest before the change")
        return
    print("Declared tools (register) vs observed tools (traces)")
    for a in reg:
        obs = observed_tools(runs, a["id"])
        extra = sorted(set(obs) - set(a["tools"]))
        unused = sorted(set(a["tools"]) - set(obs))
        status = "OK  " if not extra else "FAIL"
        line = f"  {status} {a['id']:<19} observed {len(obs)} of {len(a['tools'])} declared"
        if extra:
            line += f"; UNDECLARED {', '.join(f'{t} ({obs[t]} calls)' for t in extra)}"
        if unused and obs:
            line += f"; never called {', '.join(unused)}"
        if not obs:
            line += "; no runs this month"
        print(line)


# ---------------------------------------------------------------- kill switch
def switches():
    return json.loads((HERE / "kill_switches.json").read_text())


def log_kill(entry):
    with open(HERE / "kill_log.jsonl", "a") as f:
        f.write(json.dumps(entry) + "\n")


def kill(reg, agent_id, by, reason, at):
    a = next((x for x in reg if x["id"] == agent_id), None)
    if not a:
        sys.exit(f"Unknown agent {agent_id}")
    people = json.loads((HERE / "people.json").read_text())
    allowed = by == a["owner"] or by in people["agent_managers"] or by in people["on_call"]
    entry = {"at": at, "agent": agent_id, "action": "kill", "by": by, "reason": reason}
    if not allowed or not reason:
        entry["result"] = "REFUSED"
        log_kill(entry)
        print(f"REFUSED: {by} may not pull the switch for {agent_id} "
              f"(allowed: {people['kill_may']}; a reason is required)")
        return 2
    ks = switches()
    ks[agent_id] = {"state": "KILLED", "at": at, "by": by, "reason": reason}
    (HERE / "kill_switches.json").write_text(json.dumps(ks, indent=2))
    entry["result"] = "OK"
    log_kill(entry)
    print(f"KILLED {agent_id} at {at} by {by}")
    for p in enforcement_points(a):
        print(f"  set: {p}")
    return 0


def restore(reg, agent_id, by, cause, at):
    people = json.loads((HERE / "people.json").read_text())
    ks = switches()
    entry = {"at": at, "agent": agent_id, "action": "restore", "by": by, "cause": cause}
    cur = ks.get(agent_id)
    why = None
    if not cur or cur["state"] != "KILLED":
        why = f"{agent_id} is not killed"
    elif by not in people["agent_managers"]:
        why = f"{by} is not an Agent Manager"
    elif by == cur["by"]:
        why = f"{by} pulled the switch and may not restore it"
    elif not cause:
        why = "a root cause is required"
    if why:
        entry["result"] = "REFUSED"
        log_kill(entry)
        print(f"REFUSED: {why}")
        return 2
    ks[agent_id] = {"state": "ACTIVE", "at": at, "by": by, "cause": cause}
    (HERE / "kill_switches.json").write_text(json.dumps(ks, indent=2))
    entry["result"] = "OK"
    log_kill(entry)
    print(f"RESTORED {agent_id} at {at} by {by}")
    return 0


def enforcement_points(a):
    pts = {"joule-studio": ["Joule Studio: agent deactivated in production",
                            "AI Agent Hub: verification set to unverified"],
           "btp-custom": ["Gateway: agent key blocked", "BTP: app scaled to 0 instances"],
           "copilot-studio": ["Agent Gateway / MCP gateway: consumer removed from the access list",
                              "Copilot Studio: agent unpublished by its admin"]}[a["home"]]
    return pts + [f"SAP: technical role {a['role']} locked for the agent's user"]


def gate(reg, agent_id):
    ks = switches().get(agent_id, {"state": "ACTIVE"})
    if ks["state"] == "KILLED":
        print(f"REFUSED {agent_id}: kill switch pulled {ks['at']} by {ks['by']} ({ks['reason']})")
        return 2
    print(f"ALLOWED {agent_id}")
    return 0


# ---------------------------------------------------------------- process KPI
def process(reg):
    ev = json.loads((HERE / "process_events.json").read_text())
    print("Process KPI: median hours from block to release (synthetic)")
    for a in reg:
        if not a["kpi"]:
            continue
        def med(f):
            xs = [e["hours"] for e in ev if e["kpi"] == a["kpi"] and f(e)]
            return statistics.median(xs) if xs else None
        oct_ = med(lambda e: e["month"] == "2026-10")
        nov = med(lambda e: e["month"] == "2026-11")
        touched = med(lambda e: e["month"] == "2026-11" and e["agent_touched"])
        change = (nov - oct_) / oct_ * 100
        verdict = "MOVED" if change <= -10 else "NOT MOVED"
        print(f"  {a['id']:<17} {a['kpi']:<20} Oct {oct_:5.1f}  Nov {nov:5.1f} "
              f"({change:+.0f}%)  agent-touched {touched:5.1f}  {verdict}")


# ---------------------------------------------------------------- trust review
def last_run(a, runs):
    mine = [r["start"][:10] for r in runs if r["gen_ai.agent.id"] == a["id"]]
    return max(mine) if mine else a.get("last_run")


def review(reg, runs):
    meters = {m["id"]: m for m in meter_rows(reg, runs)}
    ks = switches()
    lines = [f"# Weekly trust review {LAB_DATE.isoformat()}", "",
             "Synthetic data: shows the method, not results from a real SAP system.", "",
             "| Agent | Owner | Runs | Override rate | USD | Last run | Verdict | Why |",
             "| --- | --- | --- | --- | --- | --- | --- | --- |"]
    counts = {}
    print(f"Weekly trust review {LAB_DATE.isoformat()}")
    for a in reg:
        m = meters[a["id"]]
        mine = [r for r in runs if r["gen_ai.agent.id"] == a["id"]]
        over = (sum(1 for r in mine if r["outcome"] in ("edited", "rejected")) / len(mine)
                if mine else 0)
        errs = sum(1 for r in mine if r["outcome"] == "error") / len(mine) if mine else 0
        lr = last_run(a, runs)
        idle = (LAB_DATE - date.fromisoformat(lr)).days if lr else 999
        undeclared = set(observed_tools(runs, a["id"])) - set(a["tools"])
        why = []
        if ks.get(a["id"], {}).get("state") == "KILLED":
            verdict = "KILLED"
            why.append("switch pulled; restore needs a root cause")
            if undeclared:
                why.append("undeclared tools: " + ", ".join(sorted(undeclared)))
        elif idle > max(30, 3 * a["cadence_days"]):
            verdict = "RETIRE"
            why.append(f"no run for {idle} days (cadence {a['cadence_days']})")
        elif undeclared:
            verdict = "FIX"
            why.append("calls tools outside its register entry: " + ", ".join(sorted(undeclared)))
        else:
            verdict = "KEEP"
        if verdict == "KEEP" and (over > 0.25 or errs > 0.05 or m["usd"] > m["budget"]):
            verdict = "WATCH"
        if over > 0.25:
            why.append(f"people override {over:.0%} of drafts")
        if errs > 0.05:
            why.append(f"errors {errs:.0%}")
        if m["usd"] > m["budget"]:
            why.append(f"over budget ({m['usd']:.2f} of {m['budget']:.2f})")
        counts[verdict] = counts.get(verdict, 0) + 1
        text = "; ".join(why) or "within limits"
        print(f"  {verdict:<7} {a['id']:<19} {text}")
        lines.append(f"| {a['id']} | {a['owner']} | {len(mine)} | {over:.0%} | {m['usd']:.2f} "
                     f"| {lr or '-'} | {verdict} | {text} |")
    print("  " + ", ".join(f"{v} {k}" for k, v in sorted(counts.items())))
    out = HERE / f"trust_review_{LAB_DATE.isoformat()}.md"
    out.write_text("\n".join(lines) + "\n")
    print(f"Wrote {out}")
    return 2 if counts.get("FIX") or counts.get("KILLED") else 0


def main():
    p = argparse.ArgumentParser(description=__doc__.splitlines()[0])
    p.add_argument("--init", action="store_true", help="write the sample fleet files")
    p.add_argument("command", nargs="?", choices=["meter", "lineage", "gate", "kill",
                                                  "restore", "process", "review"])
    p.add_argument("agent", nargs="?")
    p.add_argument("--change")
    p.add_argument("--by")
    p.add_argument("--reason", default="")
    p.add_argument("--cause", default="")
    p.add_argument("--at", default=f"{LAB_DATE.isoformat()}T09:00")
    a = p.parse_args()
    if a.init:
        init()
        return 0
    reg, runs = load()
    if a.command == "meter":
        meter(reg, runs)
    elif a.command == "lineage":
        lineage(reg, runs, a.change)
    elif a.command == "gate":
        return gate(reg, a.agent)
    elif a.command == "kill":
        return kill(reg, a.agent, a.by, a.reason, a.at)
    elif a.command == "restore":
        return restore(reg, a.agent, a.by, a.cause, a.at)
    elif a.command == "process":
        process(reg)
    elif a.command == "review":
        return review(reg, runs)
    else:
        p.print_help()
    return 0


if __name__ == "__main__":
    sys.exit(main())
```

#### Step 3: Write the sample fleet

1. Run:

   ```bash
   python unit23/fleet_ops.py --init
   ```

2. You should see one line ending in your `unit23/fleet` folder:

   ```text
   Wrote register, people, changes, runs, process events and kill switches to .../unit23/fleet
   ```

The folder now holds six agents in `register.json`, 1,556 runs in `runs.jsonl` (about 1.7 MB), three planned changes, October and November process data, and one kill switch already pulled: on Tuesday 2026-11-24 at 10:14 the on-call developer `00100288` stopped `AGT_SUPPLY_WATCH` after its runs hit the step cap from 09:00.

> **Note** Everything here is synthetic, generated with seed 42: Calder, the agents, the runs, the costs and the KPIs. The numbers show the method, not results from a real SAP system. The AI Unit price of 8.00 USD and the token prices are course values, not SAP's prices.

#### Step 4: Meter the month

1. Run:

   ```bash
   python unit23/fleet_ops.py meter
   ```

2. You should see:

   ```text
   November 2026, 1 to 27 (synthetic)
   Agent                Runs  Steps  AI Units      USD  Budget Accepted  USD/acc
   AGT_INV_TRIAGE        300   1834      9.17    73.36   90.00      246    0.298
   AGT_ORDER_EXC         600   2989     14.95   119.56  140.00      471    0.254
   AGT_SUPPLY_WATCH      500   7346      0.00    41.98   35.00      354    0.119  OVER BUDGET
                      SPIKE 2026-11-24: 1511 steps vs median 309
   sales-quote-helper    120    470      0.00     4.80   15.00       58    0.083
   AGT_CLOSE_ACCR         36    281      1.41    11.24   15.00       25    0.450
   AGT_CERT_LOOKUP         0      0      0.00     0.00    5.00        0        -
   Fleet                                                 250.94
   ```

Read it like this. The Joule Studio agents are metered in AI Units at SAP Learning's 0.005 per step, as a shadow price. `AGT_SUPPLY_WATCH` runs on Calder's own BTP runtime, so it is metered in tokens; the loop on 24 November pushed it over budget, and the spike line shows the day. The Copilot Studio helper is billed by its own platform at a course rate per run. The last column is what makes them comparable: the accruals agent costs the most per accepted draft.

> **Note** These costs come from synthetic runs and course prices. They show how to meter; they are not estimates of what SAP or any vendor charges.

#### Step 5: Check lineage and two planned changes

1. Compare declared and observed tools:

   ```bash
   python unit23/fleet_ops.py lineage
   ```

   ```text
   Declared tools (register) vs observed tools (traces)
     OK   AGT_INV_TRIAGE      observed 4 of 4 declared
     OK   AGT_ORDER_EXC       observed 3 of 3 declared
     OK   AGT_SUPPLY_WATCH    observed 3 of 3 declared
     FAIL sales-quote-helper  observed 3 of 2 declared; UNDECLARED get_customer_credit (34 calls)
     OK   AGT_CLOSE_ACCR      observed 2 of 2 declared
     OK   AGT_CERT_LOOKUP     observed 0 of 1 declared; no runs this month
   ```

   The sales quote helper reads customer credit data that nobody reviewed when it was approved. It is only a read, but the verifier never saw it.

2. Ask which agents a planned tool change affects:

   ```bash
   python unit23/fleet_ops.py lineage --change CHG-01
   ```

   ```text
   CHG-01: calder-salesorders MCP server replaces get_sales_order v1 with v2 on 2026-12-08
     AFFECTED AGT_ORDER_EXC (owner 00100296, 478 calls in November)
     AFFECTED sales-quote-helper (owner 00100266, 122 calls in November)
     2 agent(s) to retest before the change
   ```

3. Try the role change from the security redesign:

   ```bash
   python unit23/fleet_ops.py lineage --change CHG-03
   ```

   ```text
   CHG-03: Role loses display of purchase order history (security redesign)
     AFFECTED AGT_INV_TRIAGE (owner 00100244)
     1 agent(s) to retest before the change
   ```

   `CHG-02` (the purchase order API's new communication arrangement) affects three agents. Run it to see which.

#### Step 6: Work the kill switch

1. Check whether the supply watch agent may run:

   ```bash
   python unit23/fleet_ops.py gate AGT_SUPPLY_WATCH
   ```

   ```text
   REFUSED AGT_SUPPLY_WATCH: kill switch pulled 2026-11-24T10:14 by 00100288 (Runs at the step cap since 09:00)
   ```

2. The developer who pulled it fixed the retry loop and tries to restore it. The rule refuses:

   ```bash
   python unit23/fleet_ops.py restore AGT_SUPPLY_WATCH --by 00100288 --cause "fixed"
   ```

   ```text
   REFUSED: 00100288 is not an Agent Manager
   ```

3. The enterprise architect `00100290`, an Agent Manager, restores it with the root cause. On Windows PowerShell and macOS/Linux the command is the same:

   ```bash
   python unit23/fleet_ops.py restore AGT_SUPPLY_WATCH --by 00100290 --cause "Retry loop on an empty MRP result; fixed in 1.4.1, step cap 12" --at 2026-11-30T09:20
   ```

   ```text
   RESTORED AGT_SUPPLY_WATCH at 2026-11-30T09:20 by 00100290
   ```

4. A buyer tries to stop the quote helper. Only its owner, an Agent Manager or on-call may:

   ```bash
   python unit23/fleet_ops.py kill sales-quote-helper --by 00100211 --reason "test"
   ```

   ```text
   REFUSED: 00100211 may not pull the switch for sales-quote-helper (allowed: owner, Agent Manager or on-call; a reason is required)
   ```

5. Its owner, the inside sales rep `00100266`, stops it until the credit read is reviewed:

   ```bash
   python unit23/fleet_ops.py kill sales-quote-helper --by 00100266 --reason "Reads credit data outside its register entry" --at 2026-11-30T09:25
   ```

   ```text
   KILLED sales-quote-helper at 2026-11-30T09:25 by 00100266
     set: Agent Gateway / MCP gateway: consumer removed from the access list
     set: Copilot Studio: agent unpublished by its admin
     set: SAP: technical role ZT_AGENT_QUOTE locked for the agent's user
   ```

   The three `set:` lines are the enforcement points for an agent on another platform. In the lab they are printed; in a real landscape each is a separate action by a separate admin, and someone must confirm each one.

6. Open `unit23/fleet/kill_log.jsonl`. Every attempt is there, refused ones included.

#### Step 7: Read the process KPIs

1. Run:

   ```bash
   python unit23/fleet_ops.py process
   ```

   ```text
   Process KPI: median hours from block to release (synthetic)
     AGT_INV_TRIAGE    invoice_block_hours  Oct  30.4  Nov  19.1 (-37%)  agent-touched  17.2  MOVED
     AGT_ORDER_EXC     order_block_hours    Oct  25.5  Nov  25.0 (-2%)  agent-touched  24.7  NOT MOVED
   ```

The order exceptions agent has the higher acceptance in the meter, yet blocked orders wait as long as before. In Calder's process mining scenario the credit analyst reviews blocks once a day, so a faster draft doesn't release an order faster. The agent is fine; the business case isn't met.

> **Note** These KPI values are generated from synthetic data and show the comparison method only.

#### Step 8: Write the weekly trust review

1. Run:

   ```bash
   python unit23/fleet_ops.py review
   ```

2. After steps 6 and 7 you should see:

   ```text
   Weekly trust review 2026-11-30
     KEEP    AGT_INV_TRIAGE      within limits
     KEEP    AGT_ORDER_EXC       within limits
     WATCH   AGT_SUPPLY_WATCH    errors 15%; over budget (41.98 of 35.00)
     KILLED  sales-quote-helper  switch pulled; restore needs a root cause; undeclared tools: get_customer_credit; people override 52% of drafts
     WATCH   AGT_CLOSE_ACCR      people override 28% of drafts
     RETIRE  AGT_CERT_LOOKUP     no run for 89 days (cadence 7)
     2 KEEP, 1 KILLED, 1 RETIRE, 2 WATCH
   Wrote .../unit23/fleet/trust_review_2026-11-30.md
   ```

3. Open `unit23/fleet/trust_review_2026-11-30.md` in VS Code. It is the table the meeting reads.

Note that `AGT_ORDER_EXC` is KEEP although its process KPI didn't move. The weekly review judges whether the agent is healthy; the process verdict belongs to the monthly board and the quarterly portfolio review. The exit code is 2 because one agent is killed.

#### Step 9: Save your work in Git

`runs.jsonl` is large and can be rebuilt with `--init`, so commit the script and the review only.

```bash
git add unit23/fleet_ops.py unit23/fleet/trust_review_2026-11-30.md
git commit -m "Unit 23: Calder fleet operations and weekly trust review"
```

#### How the code works

| Part of the script | What it does |
| --- | --- |
| `REGISTER`, `PEOPLE`, `CHANGES` | The sample register with the operating fields, who may kill and restore, and three planned changes |
| `make_runs` | Generates November's runs as traces with OpenTelemetry-style attribute names, plus the 60-run loop on 24 November |
| `make_process` | Generates October and November block-to-release hours for invoices and orders |
| `meter_rows`, `meter` | Turns steps (Joule Studio), tokens (BTP) or runs (other platform) into USD, cost per accepted draft and a spike check |
| `lineage` | Compares declared with observed tools, or lists the agents a change affects |
| `kill`, `restore`, `gate` | The kill switch: authority rules, enforcement points, the append-only log and the check a runtime would make |
| `process` | Median hours before and after, and for agent-touched documents |
| `review` | Applies the verdict rules and writes the review table; exit code 2 on FIX or KILLED |

#### If something goes wrong

| What you see | What it means | What to do |
| --- | --- | --- |
| `python: command not found` or `'python' is not recognized` | Python isn't on your path | Follow [Set up your computer](https://erpfde.com/topics/set-up-your-computer/); on macOS/Linux try `python3` |
| `No fleet files. Run: python unit23/fleet_ops.py --init` | The sample files don't exist yet | Run step 3 |
| Your numbers differ from this page | You edited the script or the files | Run `--init` again; it rewrites every file with seed 42 |
| `REFUSED` on a restore you expected to work | The rules: Agent Manager, not the one who pulled it, a cause | Use `--by 00100290` or `00100292` and add `--cause` |
| `.venv\Scripts\Activate.ps1 cannot be loaded` | PowerShell blocks scripts | Run `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` once, then try again |
| `ModuleNotFoundError` | You aren't running this script | It uses only built-in modules; check the file name |
| A network or proxy error | Not from this script | It makes no network calls; check which command you ran |

### The SAP way

This is a **sketch** of how the same jobs map to SAP's tools on 2026-11-29. Each needs a tenant and the right licences, which Units 21 and 23 describe.

> **Note** Nothing in this section can be run without SAP BTP, SAP LeanIX or SAP AI Agent Hub, SAP Cloud ALM and SAP for Me access. Treat it as a checklist for a real landscape.

| Job | SAP tool, as SAP's pages describe it | What you still build |
| --- | --- | --- |
| Register and states | AI Agent Hub fact sheets and verification, covered in the [register topic](https://erpfde.com/topics/ai-agent-hub-and-governance/) | Operating fields (budget, cadence, KPI) as custom fields |
| Telemetry for SAP-managed agents | SAP Cloud ALM session telemetry and agent dashboards ([SAP Architecture Center](https://architecture.learning.sap.com/docs/ref-arch/jfhsd9)) | Telemetry for your own and third-party agents, in the same OpenTelemetry shape |
| Consumption | SAP for Me, near real time, by package and feature ([pricing](https://www.sap.com/products/artificial-intelligence/pricing.html), [SAP Learning](https://learning.sap.com/courses/introducing-joule/understanding-the-commercial-model)) | Cost per agent and per outcome, and token cost for BTP agents |
| Usage and value | AI Agent Hub's executive dashboard with adoption, usage and ROI ([SAP Learning](https://learning.sap.com/courses/boosting-ai-driven-business-transformation-with-joule-agents/managing-ai-agents-using-ai-agent-hub)) | The KPI baseline and the before-and-after comparison |
| Process impact | Signavio agent mining, planned for Joule Studio 2.0 agents, enabled per agent type in LeanIX ([SAP Architecture Center](https://architecture.learning.sap.com/docs/ref-arch/3c8d50)) | Today: process data from your own extraction, as in step 7 |
| Stop a third-party caller | Agent Gateway access list per consumer ([news, 27 October 2026](https://architecture.learning.sap.com/news/2026/10/27/a2a-agent-gateway-interoperability)) | The authority rule and the log |
| Stop everything Joule | Deactivate agents or features in SAP for Me ([pricing](https://www.sap.com/products/artificial-intelligence/pricing.html)) | A per-agent switch; SAP for Me is a commercial control, not an incident tool |
| Retire | AI Agent Hub's retirement steps ([SAP Architecture Center](https://architecture.learning.sap.com/docs/ref-arch/jfhsd9)) | Proof that each credential and integration is gone |

Licensing notes: AI Units are bought annually and unused units expire after 12 months, per SAP's pricing FAQ. Custom-built agents run free in the Joule Studio runtime through the end of 2026 and are then billed on resource consumption through BTPEA. Check both against your own contract.

### Build vs. SAP

| Situation | Use SAP's tools | Build your own |
| --- | --- | --- |
| Mostly SAP-delivered Joule agents | Cloud ALM dashboards and SAP for Me consumption | Only the trust review table and KPI |
| Custom Joule Studio agents | Hub register and verification | Shadow meter until SAP's 2027 metering is confirmed |
| Agents on BTP, Copilot Studio, Bedrock | Hub discovery where it exists | Traces, meter and kill switch per platform |
| Process impact now | Wait for Signavio agent mining if it fits your timeline | Before-and-after KPI from your own process data |
| Regulated process, audit-heavy | Hub records and retirement steps | Append-only kill log and evidence of each enforcement point |

### Architecture view

**Where it sits.** The operating layer reads from every runtime and writes back to the register; the kill switch reaches into each runtime.

```mermaid
flowchart LR
  subgraph Runtimes
    JS[Joule Studio agents<br/>INV_TRIAGE, ORDER_EXC]
    BTP[BTP app<br/>SUPPLY_WATCH]
    CS[Copilot Studio<br/>quote helper]
  end
  JS --> ALM[SAP Cloud ALM]
  BTP -->|OpenTelemetry| TS[Trace store]
  CS -->|platform export| TS
  ALM --> OPS[Fleet operations:<br/>meter, lineage, review]
  TS --> OPS
  SFM[SAP for Me<br/>AI Units] --> OPS
  S4[S/4HANA CP10<br/>process data] --> OPS
  OPS --> HUB[AI Agent Hub<br/>register]
  KS[Kill switch] --> JS
  KS --> AG[Agent Gateway ACL]
  KS --> BTP
  KS --> S4R[SAP technical role]
```

**Non-functional requirements that decide the design.**

| Requirement | Typical target | What breaks if missed |
| --- | --- | --- |
| Time to stop | Every enforcement point refuses within 15 minutes of the pull (course target) | A looping or misbehaving agent keeps acting |
| Meter freshness | Hourly per agent | A loop is found by the invoice, not the alert |
| Trace coverage | Every production agent emits agent, model and tool spans | Lineage and impact analysis are blind for that agent |
| Data protection | Trace content follows the data's access rules | Business and personal data leak through observability |
| Cost of operating | Telemetry costs well below the agents' own cost | Observability becomes the bigger bill |

**Integration and identity.** Telemetry flows one way, from runtimes to Cloud ALM or a trace store. The kill switch flows the other way and needs administrator rights in each runtime, so it is a small, audited set of people. Each agent should act with its own identity, as the [register topic](https://erpfde.com/topics/ai-agent-hub-and-governance/) explains; a shared technical user can't be locked for one agent without stopping the others.

**The decision to record.**

- **Context:** Calder runs six agents on three platforms. SAP Cloud ALM covers SAP-managed agents; Signavio agent mining is planned; custom Joule Studio agents are free until the end of 2026, with 2027 metering to confirm.
- **Options:** A wait for SAP's tools to cover everything; B build a full observability platform; C keep the register in AI Agent Hub, use Cloud ALM and SAP for Me where they apply, and run a small fleet job (meter, lineage, review) over OpenTelemetry traces from every runtime.
- **Decision:** C.
- **Consequences:** Every agent emits the same trace shape now. The fleet job retires piece by piece as SAP's tools cover a job, starting with process impact if Signavio agent mining reaches GA for Calder's agents. The kill switch is tested quarterly in the test tenant.

**What a design review will ask.**

1. For each agent, which enforcement points does the kill switch close, and how long did the last test take?
2. Where do traces live, who can read them, and how long are they kept?
3. How is a custom Joule Studio agent metered from January 2027, and who confirmed it with SAP?
4. Which process KPI does each agent move, and what was the baseline?
5. Which change processes call the impact analysis before they release?

### Production concerns

- **Security and SAP authorizations.** The people who can pull the switch are few and named. Restoring needs a second person. Each agent's SAP user is its own, so locking it stops only that agent. The trace store gets the same access rules as the data in it.
- **Evaluation.** The override rate is a free, continuous evaluation signal: people edit or reject drafts that are wrong. Sample those runs into the evaluation set from [evaluating agents](https://erpfde.com/topics/evaluating-agents/).
- **Cost.** Meter hourly, alert on spikes per agent, and keep a step cap in every agent. SAP for Me's deactivation is a last resort for the whole account.
- **Operations.** Test the kill switch on a schedule. Keep the review short: one table, verdicts, owners, due dates.
- **Clean core.** Read process data through released APIs or extraction, never by direct table reads from the agent platform.

### Where AI fits

AI changes this subject in two ways. First, agents are the thing being operated, so everything above is new work. Second, SAP lists an AI governance assistant in AI Agent Hub, in preview ([SAP Architecture Center](https://architecture.learning.sap.com/docs/ref-arch/jfhsd9)). A model can draft the weekly review's commentary or group similar overrides, but the verdicts should stay rule-based and the restore decision with a person. For an agent that reviews other agents' logs, the same prompt-injection risks apply as anywhere: see [prompt injection and tool poisoning](https://erpfde.com/topics/prompt-injection-and-tool-poisoning/).

### Pitfalls

- **Metering in each platform's unit.** AI Units, tokens and per-run fees can't be compared; money per outcome can.
- **A kill switch that closes one door.** The runtime stops, but the gateway key and the SAP role still work.
- **The person who pulled it restores it.** Fast stop, fast restore, no root cause.
- **Idle rules without cadence.** A monthly agent is retired mid-month, or a dead weekly agent survives because the rule is too loose.
- **Lineage from the register only.** The register says what was approved; traces say what happens.
- **Agent metrics as the business case.** Acceptance and latency look good while the process KPI is flat.
- **Traces with everything in them.** Full prompts and results stored for everyone to read.
- **Counting on planned features.** Building next year's operating model on a capability SAP describes as planned.

### Exercise

Add a cost-per-outcome limit to the trust review. The board wants an agent flagged when one accepted draft costs more than 0.30 USD.

1. Run `python unit23/fleet_ops.py --init` to start from clean files.
2. Open `unit23/fleet/register.json`. For `AGT_INV_TRIAGE`, `AGT_ORDER_EXC` and `AGT_CLOSE_ACCR`, add the line `"max_usd_per_outcome": 0.30,` inside the entry, for example after `"budget_usd"`. Save. Don't run `--init` again, or it overwrites your edit.
3. Open `unit23/fleet_ops.py` and find these two lines in `review`:

   ```python
           if m["usd"] > m["budget"]:
               why.append(f"over budget ({m['usd']:.2f} of {m['budget']:.2f})")
   ```

4. Directly below them, at the same indentation, add:

   ```python
           cap = a.get("max_usd_per_outcome")
           if cap and m["per_good"] and m["per_good"] > cap:
               if verdict == "KEEP":
                   verdict = "WATCH"
               why.append(f"cost per {a['outcome']} {m['per_good']:.3f} above {cap:.2f}")
   ```

5. Save and run `python unit23/fleet_ops.py review`.
6. In one sentence in the review file, say what the accruals agent's owner should bring to next week's meeting.

**Done when** the review prints `WATCH   AGT_CLOSE_ACCR      people override 28% of drafts; cost per accepted draft 0.450 above 0.30`, the invoice and order agents stay KEEP, and your sentence is in the file. Keep the review file: Unit 32's capstone asks for an operating model, and this table is its weekly evidence.

### Going further

For readers who want the standards and SAP's planned tooling behind fleet operations.

- [OpenTelemetry GenAI agent spans](https://raw.githubusercontent.com/open-telemetry/semantic-conventions-genai/2e994c6d59a93bb4fc1752c5378eedb9b8e14d6b/docs/gen-ai/gen-ai-agent-spans.md) defines operations beyond the three used here, such as `plan` and `invoke_workflow`, and when an agent span is a client call or internal. Read it before you design multi-agent traces, because a supervisor and its workers should share one trace.
- [OpenTelemetry GenAI client spans](https://raw.githubusercontent.com/open-telemetry/semantic-conventions-genai/main/docs/gen-ai/gen-ai-spans.md) covers token attributes including cached tokens and the opt-in capture of message content, which is where the data protection decision lives.
- [AI Agent Behavior Mining with SAP Signavio](https://architecture.learning.sap.com/docs/ref-arch/3c8d50) describes how traces would be normalized into an event log for process mining. It is planned, but its design shows which trace fields to keep now so that mining can use them later.
- [SAP AI Agent Hub](https://architecture.learning.sap.com/docs/ref-arch/jfhsd9) describes the full lifecycle from Define to Optimize; compare its Monitor and Optimize stages with this topic's weekly review to see which parts SAP intends to cover.

The hard problems at scale are attribution and sampling. When one agent calls another through A2A, whose budget pays for the second agent's steps? Decide it in the register (the caller pays is a common rule) and carry the caller's agent ID in the trace. And when a fleet runs tens of thousands of runs a day, keep every trace's numbers (tokens, tools, outcome) but sample the content, so the meter and lineage stay complete while the trace store stays affordable and safe.

### Check yourself

1. What three records does the fleet's weekly review compare?
   - A. Prompts, model versions and evaluation scores
   - B. The register entry, the traces and the process data
   - C. AI Unit balance, BTP credits and the monthly token bill
   - D. Owner, verifier and Agent Manager sign-offs

   Answer: B. The register says what the agent should do, traces say what it did, and process data says what it changed. The review compares the three and gives a verdict.

2. Calder meters Joule Studio agents in AI Units, the BTP agent in tokens and the Copilot Studio helper per run. How does the meter make them comparable?
   - A. It converts every agent's usage into AI Units at SAP's rate
   - B. It counts only model calls and ignores tool calls
   - C. It turns each into money and divides by accepted drafts
   - D. It ranks agents by their total number of steps

   Answer: C. Units differ by platform, so the meter normalizes to cost and then to cost per useful result. Steps or AI Units alone can't be compared across runtimes.

3. Why does the meter check for a spike day as well as the monthly budget?
   - A. Because SAP bills AI Units per day, not per month
   - B. A loop shows in one day's steps before the budget moves
   - C. Because budgets only apply to SAP-delivered Joule agents
   - D. To find which user started the most runs

   Answer: B. On 24 November the supply watch agent hit the step cap for an hour. The day's steps were about five times the median, a signal hours before the month's total crossed its budget.

4. Lineage shows the sales quote helper calling `get_customer_credit`, which isn't in its register entry. It only reads. What should happen?
   - A. Nothing, because reads can't change SAP data
   - B. Add the tool to the register quietly so that lineage passes
   - C. Retire the helper because it broke a rule
   - D. A finding: declare and re-verify it, or remove the call

   Answer: D. The verifier approved the helper without seeing credit data. Undeclared reads still expose data nobody reviewed, so the owner either declares it for verification or removes the call.

5. Security plans CHG-03, removing purchase order history display from `ZT_AGENT_INVOICE_TRIAGE`. What does impact analysis give the change team?
   - A. The agents using that role, and their owners to retest
   - B. The cost of the change in AI Units for next month
   - C. A new verification date for every agent in the fleet
   - D. An automatic rollback if the invoice agent starts failing

   Answer: A. Impact analysis turns lineage around: given a change, list the affected agents. The owners retest before the release, as they would for an interface.

6. In the lab, the developer who pulled the supply watch agent's switch tries to restore it with the fix. Why is it refused?
   - A. On-call people may not pull switches either
   - B. A restore must wait until the next weekly review
   - C. Only an Agent Manager who didn't pull it may restore
   - D. The kill log is append-only, so a switch can't be reversed

   Answer: C. Pulling is fast and several people may do it. Restoring needs a second person and a root cause, so the agent doesn't return before someone checks why it stopped.

7. Your kill switch deactivates a Copilot Studio agent, but it can still call SAP. What was missed?
   - A. The agent's AI Unit consumption in SAP for Me
   - B. A new verification in AI Agent Hub
   - C. The Signavio mining setting for that agent's type
   - D. Its gateway access list entry and its SAP role

   Answer: D. An agent can act through its runtime, a gateway and an SAP user. A kill switch must close each one, and someone must confirm each is closed.

8. The accruals agent ran only on 2 to 4 November. Why doesn't the review retire it on 30 November?
   - A. Its owner is a G/L accountant, who is exempt from the rule
   - B. Its expected cadence is monthly, so 26 idle days are normal
   - C. Agents with an override rate above 25% are never retired
   - D. Joule Studio agents can't be retired before the end of the year 2026

   Answer: B. The idle rule uses each agent's cadence: more than three times the cadence and at least 30 days. A fixed short rule would retire a monthly agent in the middle of every month.

9. The order exceptions agent is KEEP in the review, but its process KPI didn't move. What does an FDE do with that?
   - A. Ignore the KPI, since the agent's own numbers are healthy
   - B. Kill the agent until the KPI improves
   - C. Raise the agent's budget so it can run more often
   - D. Take it to the board: the bottleneck is in the process

   Answer: D. The weekly review judges agent health; the board judges the business case. Blocks wait for the credit analyst's daily review, so the fix is in the process, not the agent.

10. Your agents emit OpenTelemetry GenAI spans. What should you keep in mind about those conventions in November 2026?
   - A. They are stable and frozen, so names won't change
   - B. They only cover OpenAI models
   - C. They are marked Development, so pin the version you emit
   - D. SAP Cloud ALM rejects any trace that uses these attribute names

   Answer: C. The GenAI conventions are in Development and moved to their own repository, so attribute names can still change. Pinning the version keeps your meter and lineage readable.

## Sources

- [SAP AI Agent Hub (SAP Architecture Center, updated 19 October 2026)](https://architecture.learning.sap.com/docs/ref-arch/jfhsd9): read 2026-11-29; Monitor stage: SAP Cloud ALM receives session telemetry from SAP-managed agents, dashboards for evaluation rates, error root causes, session volumes and performance trends; recurring access reviews, recertification and risk-tier reassessment; Enforce stage: consumption limits, model-routing rules and the ability to suspend or revoke an agent; Optimize: improve or retire, retirement revokes credentials, disables integrations, transfers ownership, preserves audit records; Agent Manager typically an enterprise architect or IT governance lead; no GA labels; governance assistant in preview
- [Managing AI agents using AI Agent Hub (SAP Learning)](https://learning.sap.com/courses/boosting-ai-driven-business-transformation-with-joule-agents/managing-ai-agents-using-ai-agent-hub): read 2026-11-29, no page date; hub as system of record; understand agent usage, assess benefits and costs; executive dashboard with adoption trends, usage metrics and ROI
- [AI Agent Behavior Mining with SAP Signavio (SAP Architecture Center, updated 2 June 2026)](https://architecture.learning.sap.com/docs/ref-arch/3c8d50): read 2026-11-29; describes the planned mining model for agents built on Joule Studio 2.0, not yet GA; behavioral tracing, conformance, KPI impact (cycle time, exception rates, throughput), cost per agent execution, benchmarking across versions; relies on OpenTelemetry traces; enabled per agent type in LeanIX; agents outside SAP a future direction; traces may contain sensitive data
- [How SAP Signavio agent mining transforms enterprise AI (SAP News, 18 November 2025)](https://news.sap.com/2025/11/how-sap-signavio-agent-mining-transforms-enterprise-ai/): read 2026-11-29; trace agent behavior, measure influence on process time, accuracy and compliance, monitor computational or LLM-related cost, benchmark runs; can extend from Joule Agents to third-party or custom agents; no availability date
- [SAP AI plans and pricing (sap.com)](https://www.sap.com/products/artificial-intelligence/pricing.html): read 2026-11-29, no page date; Joule Agents priced on AI Units per action, tracked at the action level; SAP-delivered agents in 2026 at 0.02 AI Units per action; SAP for Me near real-time consumption; deactivate agents or features in SAP for Me when nearing the purchased volume; unused AI Units expire after 12 months; custom-built agents run free in the Joule Studio runtime through the end of 2026, then billed on resource consumption through BTPEA
- [Understanding the commercial model (SAP Learning, Introducing Joule)](https://learning.sap.com/courses/introducing-joule/understanding-the-commercial-model): read 2026-11-29, no page date; agent usage measured in steps; consumption rates Basic 0.005, Standard 0.01, Advanced 0.025 AI Units per step; customer-built agents generally Basic; SAP for Me breakdown by package and feature
- [Explaining central observability tools (SAP Learning, Operating SAP Business AI Platform)](https://learning.sap.com/courses/operating-sap-business-ai-platform/explaining-central-observability-tools_c3e8a8ad-76e5-43ec-a7b9-0705532a44fd): read 2026-11-29, no page date; SAP Cloud ALM for Operations entitlement with an SAP cloud subscription or Enterprise Support; health, integration and exception, job monitoring; inbound and outbound raw data APIs based on OpenTelemetry for metrics, logs and traces; Analytics API
- [Third-party agents can now interoperate with SAP Agents via the Agent Gateway (SAP Architecture Center news, 27 October 2026)](https://architecture.learning.sap.com/news/2026/10/27/a2a-agent-gateway-interoperability): read 2026-11-29; October 2026 GA of inbound A2A; consumer registered in SAP for Me grants no access by itself; ACL of SAP agents a consumer may invoke, changed by updating the access-control formation without onboarding again; every call checks token, tenant and ACL; outbound A2A and MCP future
- [Semantic conventions for GenAI agent and framework spans (OpenTelemetry, semantic-conventions-genai)](https://raw.githubusercontent.com/open-telemetry/semantic-conventions-genai/2e994c6d59a93bb4fc1752c5378eedb9b8e14d6b/docs/gen-ai/gen-ai-agent-spans.md): read 2026-11-29; status Development; operations include invoke_agent, execute_tool, chat, plan, invoke_workflow; attributes gen_ai.agent.id, gen_ai.agent.name, gen_ai.provider.name, gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, gen_ai.conversation.id
- [Semantic conventions for generative client AI spans (OpenTelemetry, semantic-conventions-genai)](https://raw.githubusercontent.com/open-telemetry/semantic-conventions-genai/main/docs/gen-ai/gen-ai-spans.md): read 2026-11-29; status Development; the GenAI conventions have moved from the main semantic conventions to this repository; content capture is opt-in
