Orchestrate

Report an issue

Something wrong, out of date or unclear? Tell us. Corrections are prioritized over new topics. You don't need to sign in.

0 / 2000

Don't include personal or confidential company details. Reports are reviewed with AI assistance.

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.

Updated Nov 29, 2026
Foundational layer · 9 min read

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) 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) 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) 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) 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) 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

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

All course terms, A to Z, in the glossary

  • 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

Pick one answer for each question. The explanation appears after you choose.

1What turns a set of agents into a fleet that needs operating?

Answer: D. 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.

2Finance sees one large AI line on the bill and asks which team caused it. What was missing?

Answer: A. 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.

3Security plans to remove a permission from a role next week. What should the platform team produce first?

Answer: D. 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.

4Who should decide that a stopped agent comes back?

Answer: C. 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.

5An agent's drafts are accepted 80% of the time, but blocked orders wait as long as before. What does that tell a leader?

Answer: C. 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.

6An agent's builder left the company and nobody has used the agent for three months. What should the review decide?

Answer: B. 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.

7Which of these does SAP describe as planned, not generally available, on 2026-11-29?

Answer: C. 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 · 38 min read

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, 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

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). 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). 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.
  • 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 and grouping cost by use case in 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). 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). As of November 2026 these conventions are marked Development and have moved to their own repository (OpenTelemetry GenAI spans), 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), and SAP Cloud ALM's raw data APIs for metrics, logs and traces are based on OpenTelemetry (SAP Learning). 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; where BTP workloads send their telemetry is in observability on BTP.

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). 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 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). 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 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 and Set up for Unit 23. This script needs no account and no network.

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]

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):

      .venv\Scripts\Activate.ps1
    • macOS / Linux:

      source .venv/bin/activate
  4. Make sure the unit23 folder exists. The command does nothing if it is already there.

    • Windows (PowerShell):

      New-Item -ItemType Directory -Force unit23
    • macOS / Linux:

      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.
"""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:

    python unit23/fleet_ops.py --init
  2. You should see one line ending in your unit23/fleet folder:

    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.

Step 4: Meter the month

  1. Run:

    python unit23/fleet_ops.py meter
  2. You should see:

    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.

Step 5: Check lineage and two planned changes

  1. Compare declared and observed tools:

    python unit23/fleet_ops.py lineage
    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:

    python unit23/fleet_ops.py lineage --change CHG-01
    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:

    python unit23/fleet_ops.py lineage --change CHG-03
    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:

    python unit23/fleet_ops.py gate AGT_SUPPLY_WATCH
    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:

    python unit23/fleet_ops.py restore AGT_SUPPLY_WATCH --by 00100288 --cause "fixed"
    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:

    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
    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:

    python unit23/fleet_ops.py kill sales-quote-helper --by 00100211 --reason "test"
    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:

    python unit23/fleet_ops.py kill sales-quote-helper --by 00100266 --reason "Reads credit data outside its register entry" --at 2026-11-30T09:25
    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:

    python unit23/fleet_ops.py process
    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.

Step 8: Write the weekly trust review

  1. Run:

    python unit23/fleet_ops.py review
  2. After steps 6 and 7 you should see:

    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.

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; 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.

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 Operating fields (budget, cadence, KPI) as custom fields
Telemetry for SAP-managed agents SAP Cloud ALM session telemetry and agent dashboards (SAP Architecture Center) 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, SAP Learning) 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) 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) 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) The authority rule and the log
Stop everything Joule Deactivate agents or features in SAP for Me (pricing) 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) 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.

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 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.
  • 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). 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.

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:

            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:

            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 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 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 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 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

Pick one answer for each question. The explanation appears after you choose.

1What three records does the fleet's weekly review compare?

Answer: A. 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.

2Calder 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?

Answer: B. 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.

3Why does the meter check for a spike day as well as the monthly budget?

Answer: A. 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.

4Lineage shows the sales quote helper calling get_customer_credit, which isn't in its register entry. It only reads. What should happen?

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.

5Security plans CHG-03, removing purchase order history display from ZT_AGENT_INVOICE_TRIAGE. What does impact analysis give the change team?

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.

6In the lab, the developer who pulled the supply watch agent's switch tries to restore it with the fix. Why is it refused?

Answer: B. 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.

7Your kill switch deactivates a Copilot Studio agent, but it can still call SAP. What was missed?

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.

8The accruals agent ran only on 2 to 4 November. Why doesn't the review retire it on 30 November?

Answer: C. 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.

9The order exceptions agent is KEEP in the review, but its process KPI didn't move. What does an FDE do with that?

Answer: B. 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.

10Your agents emit OpenTelemetry GenAI spans. What should you keep in mind about those conventions in November 2026?

Answer: B. 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.
NextSAP AI Core and AI Launchpad for architects: tenancy, isolation and what you operateDecide how many SAP AI Core instances you need, how to split workloads into resource groups, which region each uses, and who may change production.

Sources

Sign in to track your progress

We'll email you a one-time sign-in link. No password needed.

or

Tell us a little about you

Optional, every field. It helps us pitch answers to your questions at the right level and decide which topics to write next. It is never shown publicly, and you can change or clear it anytime from the account menu.

SAP areas you work in