Joule beside Microsoft 365 Copilot and other assistants
Decide which assistant owns which task when Joule sits beside Microsoft 365 Copilot and other agents, and how the user's identity crosses between them.
Most companies that run SAP also give their staff Microsoft 365 Copilot, and some use Gemini Enterprise or another assistant. People will ask SAP questions wherever they already work. So the question is not "Joule or Copilot", but which assistant answers which question, and as whom.
SAP offers two kinds of connection, as of November 2026:
Joule and Microsoft 365 Copilot, both ways. From Teams or Copilot you can reach Joule for SAP tasks; from Joule you can reach Microsoft 365 information such as email. SAP and Microsoft call this generally available since early 2026 (SAP News, Microsoft).
Agents talking to agents. Another platform's agent (Copilot Studio, Gemini Enterprise, AWS) calls a Joule agent through SAP's Agent Gateway, or Joule calls an outside agent. This uses the open A2A protocol. SAP's own pages disagree on whether it is generally available yet (SAP Architecture Center).
The rule that keeps this safe: one owner per task, and SAP changes stay with SAP. The user's own identity must reach SAP at every hop, never a shared account.
Adoption. A clerk who lives in Teams will not open a second app to ask about a blocked order. Reaching Joule from Teams removes that step.
Duplicate answers. If Copilot and Joule can both answer "which orders are blocked?", two people get two answers. Nobody knows which one is right, and support has two places to look.
Control. SAP checks a user's authorizations for every action Joule takes. If another assistant changes SAP data through its own connection, that check can be skipped or made with a shared account. An auditor will ask who released a credit block; "the Copilot agent" is not an answer.
Cost. Each side has its own meter. SAP's product page says AI Units are currently required for the Joule and Microsoft 365 Copilot feature (SAP). Microsoft and SAP's joint post says you need Joule Base and a Microsoft 365 licence, and a Microsoft 365 Copilot licence only for Copilot skills used within Joule (Microsoft). SAP's setup lesson lists a licensed Copilot environment as a prerequisite (SAP Learning). Get both vendors to confirm in writing.
At the fictional Calder Pumpworks, customer service works in Teams, the credit analyst reads customer emails in Outlook and releases credit blocks in SAP, and the transport planner wants truck arrival times from a carrier's own agent. Each of those is a different owner.
Joule and Microsoft 365 Copilot. SAP's lesson says the integration connects the two "without merging them", starts with Microsoft Teams, tells the user whether Joule or Copilot answered, and is opt-in for both products (SAP Learning). Microsoft's post adds Word, PowerPoint, Excel and OneNote, and says Joule routes to Copilot when Microsoft 365 context is relevant (Microsoft).
Identity across the two. Users sign in with Microsoft Entra ID, which is federated with SAP Cloud Identity Services. An SAP expert's setup guide says Joule keeps a one-to-one relationship with an Entra ID tenant, so a test Joule needs its own test tenant (SAP Community).
Copilot Studio to Joule agents. SAP's reference architecture (23 October 2026) has a Copilot Studio agent hand SAP tasks to Joule agents through a custom connector and SAP's Agent Gateway, keeping the named user. It says the gateway is not yet GA (SAP Architecture Center). SAP's news post four days later announces GA of inbound A2A in October 2026 (SAP Architecture Center news). Ask SAP which applies to your contract.
Gemini Enterprise. The same pattern, with Gemini Enterprise as the assistant the user talks to and Joule agents doing the SAP part, also marked not yet GA (SAP Architecture Center).
Joule calling outside agents. Joule can call an external agent over A2A and stay the orchestrator. SAP's page marks parts of this as not yet GA and expects an answer within 60 seconds (SAP Architecture Center).
A one-page ownership table is the main deliverable of this topic. Here is Calder's.
Task
Where the user is
Owner
Why
Which of my orders are blocked?
Teams
Joule
SAP data, read within the clerk's SAP authorizations
Summarize Hallam's emails about the credit hold
Joule
Microsoft 365 Copilot
The emails live in Microsoft 365
Draft a reply to Hallam
Outlook
Microsoft 365 Copilot
No SAP data needed
Release the credit block on an order
Teams
Joule, with confirmation
A change in SAP; only the credit analyst's role may do it
What is the next step on this blocked order?
Copilot Studio agent
Calder's order exceptions agent in Joule
The logic lives in SAP; Copilot Studio only asks
When does the truck arrive?
Joule
The carrier's agent
The carrier owns the answer; Joule asks it
Three rules make the table: the system that holds the data owns the answer; every change to SAP data goes through Joule's confirmation under an SAP role; each task has exactly one owner, written down.
"Joule in Teams replaces our own Copilot Studio agent." Joule answers what its skills and agents cover. A Calder-specific agent is still yours to build; the integration only lets the two reach each other.
"If both assistants can answer, more coverage is better." Two owners give two answers. Pick one.
"The other platform's agent can use a service account into SAP." SAP's pattern needs a user token for invoking an SAP agent, and the user's authorizations apply (SAP Architecture Center news).
"It's GA, so every part is GA." The Joule and Microsoft 365 Copilot integration is GA; agent-to-agent pieces carry mixed labels on SAP's own pages.
"One Entra tenant can serve test and production Joule." SAP's expert guide says the relationship is one to one.
Pick one answer for each question. The explanation appears after you choose.
1Calder's clerks live in Teams and keep asking about blocked orders. What does the Joule and Microsoft 365 Copilot integration give them?
Answer: B. SAP's lesson says the integration connects the two without merging them, starts in Teams and shows which assistant answered. SAP data stays in SAP and Joule reads it within the user's authorizations.
2Both Joule and a Copilot Studio agent can answer "which orders are blocked?". What should the architect do?
Answer: A. Two owners give two answers and two places to fix problems. The ownership table names one owner per task.
3Who should own "release the credit block on order 1000002"?
Answer: D. It changes SAP data, so it goes through Joule's confirmation and SAP's authorization check. The entry point can be Teams; the owner is still Joule.
4A business case for the integration counts only Microsoft 365 Copilot licences. What is missing?
Answer: C. SAP's product page says AI Units are currently required for the feature, and Microsoft's post names Joule Base as a prerequisite. Both meters belong in the case.
5The partner proposes one Microsoft Entra ID tenant for both test and production Joule. What do you answer?
Answer: A. SAP's expert setup guide says Joule has a one-to-one relationship with an Entra ID tenant and recommends a test tenant. Sharing one would mix the two environments.
6A Copilot Studio agent will call a Joule agent through SAP's Agent Gateway. What is the key question for the vendor?
Answer: A. SAP's pattern keeps the named user so authorizations and audit work, and SAP's pages give mixed GA labels for the gateway. Both decide whether the design can go live.
Treat every assistant as a front door and every system of record as a room. A front door may lead to many rooms, but each room has one keeper. Joule keeps SAP's rooms; Microsoft 365 Copilot keeps the Microsoft 365 rooms (mail, chats, files); a carrier's agent keeps the carrier's.
Three things then decide every design:
Routing: which keeper answers a request that arrives at a given door.
Identity: the person who knocked must still be the person when the keeper opens the room. SAP checks that person's authorizations, not the door's.
Status: each corridor between doors and rooms has its own GA label, and it changes month by month.
The deliverable is an ownership table plus the identity path for each corridor. This topic builds both, checks them against ten rules and traces six requests.
SAP documents three corridors. How Joule works covers what happens inside Joule once a request arrives; this section covers how it arrives from, or leaves to, another assistant.
sequenceDiagram
participant U as User in Teams
participant M as Microsoft 365 Copilot
participant E as Entra ID
participant I as Cloud Identity Services
participant J as Joule
participant S as S/4HANA
U->>M: SAP question
M->>E: user signed in
E->>I: federated sign-in
M->>J: hand over to Joule
J->>S: call as the mapped SAP user
S-->>J: data within the user's roles
J-->>U: answer marked as from Joule
What it is. A product integration, not something you build. SAP's lesson lists a licensed Microsoft 365 Copilot environment, an activated Joule, identity alignment, and network and trust configuration as prerequisites. The integration is opt-in and enabled by default for neither product (SAP Learning).
Both directions. In Microsoft 365, Copilot reaches SAP processes and data through Joule. In SAP, Joule routes to Copilot when Microsoft 365 context such as email, Teams, SharePoint or OneDrive is relevant (Microsoft Tech Community, 27 January 2026).
Setup outline. An SAP product expert's guide describes the work: trust between Cloud Identity Services and Entra ID, admin consent for SAP's Teams bot app in Entra, a delegated access_as_user permission on the federation app, and a system of type Microsoft 365 Copilot for SAP Joule added to the Joule formation (SAP Community). The guide also says Joule keeps a one-to-one relationship with an Entra ID tenant. SAP's lesson points to Discovery Center mission 4741 and a Help Portal page for the authoritative steps; this run could not open the Help Portal page.
Status. SAP lists the bidirectional integration as general availability in its Q4 2025 release highlights (SAP News, 14 January 2026).
#Corridor 2: another platform's agent calls a Joule agent (inbound A2A)
sequenceDiagram
participant C as Copilot Studio agent
participant X as Custom connector
participant I as Cloud Identity Services
participant G as Agent Gateway
participant A as Joule agent
C->>X: SAP task, with the user's token
X->>I: token exchange (jwt-bearer, resource = gateway)
I-->>X: token for the gateway, same user
X->>G: A2A call
G->>G: check token, tenant, access list
G->>A: route
A-->>C: result, as the named user
The pattern. SAP's Copilot reference architecture sends the call through a Power Platform custom connector that exchanges the token at Cloud Identity Services, then calls the Agent Gateway. It says Copilot Studio's native add-agent path can't perform that exchange (SAP Architecture Center, 23 October 2026). Gemini Enterprise uses a proxy agent on Google's agent runtime for the same job (SAP Architecture Center, 27 October 2026).
The token. The exchange uses the urn:ietf:params:oauth:grant-type:jwt-bearer grant with a resource parameter. The new token's audience follows the resource; the subject and user type are kept. User types are user, techUser and agentUser. When an agent acts for a user, it gets the narrower of the user's and the agent's permissions. The token's authorization claim must hold access@agent for the target (SAP Architecture Center, 13 October 2026). The gateway audience on the Gemini page is urn:sap:identity:application:provider:name:agent-gateway.
Onboarding. SAP's news post describes three SAP-managed formations: identity (integration with Cloud Identity Services), trust (Agent Gateway for Third Party) and authorization (Agent Gateway Consumer, which creates an access list). It adds that discovery doesn't grant permission, and that invoking an SAP agent needs a user token (SAP Architecture Center news, 27 October 2026).
Status. The news post announces October 2026 GA of inbound A2A. The Copilot and Gemini reference pages, updated days earlier, say the Agent Gateway is not yet GA. Record both and ask SAP.
#Corridor 3: Joule calls an outside agent (outbound A2A)
Joule stays the orchestrator and calls the outside agent as an A2A client. A low-code agent from Joule Studio gets its scenario automatically; a pro-code agent needs a Joule scenario with a dialog function of action type agent-request pointing at the agent's A2A endpoint. Trust is an IAS App2App relationship between Joule and the agent's server. Joule expects a synchronous answer within 60 seconds; longer work uses push notifications to a Joule webhook. The page names A2A 0.3.0 and message/send (SAP Architecture Center, 26 October 2026). SAP's news post calls outbound A2A future scope for third-party agents, so treat this corridor as pilot work.
SAP's pages don't agree on one answer, and they don't need to: it depends on the door. The outbound page makes Joule "the central orchestrator" for users who start in Joule. The Gemini page makes Gemini Enterprise the orchestrator the user talks to, delegating SAP tasks to Joule agents. For an architect the rule is simpler than the debate: the assistant at the user's door orchestrates; the keeper of the data answers.
Before you start: finish Set up your computer for this course and Set up for Unit 23. This lab needs no SAP or Microsoft account, no key and no network. Neither the Microsoft 365 Copilot integration nor the Agent Gateway has a free trial you could wire up here, so you review Calder's design as data.
You will write Calder's assistant design as two files (a partner's draft and a reviewed version), check them against ten rules, trace six tasks hop by hop, and produce the ownership table as a markdown file for a design document.
flowchart LR
I[--init] --> DR[assistants_draft.json]
I --> RV[assistants_reviewed.json]
DR --> R[--review<br/>rules A01-A10]
RV --> R
DR --> T[--trace<br/>T01-T06]
RV --> T
T --> L[assistant_trace.jsonl]
RV --> O[--owners]
O --> MD[assistant_owners.md]
The script is a course stand-in. It reads a design and simulates the hops; it signs no tokens and calls no service. Rules A01 to A07 come from SAP's and Microsoft's pages cited above; A08 to A10 are course rules.
In VS Code, create the file unit23/assistant_routes.py.
Paste the code below and save.
"""Review who owns which task when Joule sits beside other assistants, and trace the requests.
Usage (run from the orchestrate-course folder):
python unit23/assistant_routes.py --init write the draft and reviewed designs
python unit23/assistant_routes.py --design FILE --review check the design against rules A01-A10
python unit23/assistant_routes.py --design FILE --trace trace every task, hop by hop
python unit23/assistant_routes.py --design FILE --trace --only T05
python unit23/assistant_routes.py --design FILE --owners write unit23/assistant_owners.md
Options:
--force let --init overwrite existing design files
Built-in modules only, no account, no network, no randomness. This is a course stand-in:
it checks a design written as data and simulates the hops; it calls no SAP or Microsoft
service. Calder Pumpworks is fictional; tenants, users, agents, rules A01-A10 and records
are course labels, not SAP or Microsoft values.
"""
import argparse
import copy
import json
import sys
from pathlib import Path
HERE = Path(__file__).resolve().parent
GATEWAY = "urn:sap:identity:application:provider:name:agent-gateway"
REVIEWED = {
"as_of": "2026-11-28",
"joule_instances": {
"joule-prod": {"tier": "production", "identity_tenant": "calder-ias",
"entra_tenant": "calder-entra"},
"joule-nonprod": {"tier": "non-production", "identity_tenant": "calder-ias-test",
"entra_tenant": "calder-entra-test"},
},
"people": {
"cs.clerk@calder-pumpworks.example": {"sap_user": "00100265", "label": "customer service clerk",
"sap_roles": ["JOULE_O2C_CLERK"]},
"credit.analyst@calder-pumpworks.example": {"sap_user": "00100304", "label": "credit analyst",
"sap_roles": ["JOULE_O2C_CLERK", "JOULE_CREDIT_ANALYST"]},
"logistics.planner@calder-pumpworks.example": {"sap_user": "00100322", "label": "transport planner",
"sap_roles": ["JOULE_O2C_CLERK"]},
},
"integrations": {
"M365": {
"kind": "joule-m365-copilot", "joule": "joule-prod", "entra_tenant": "calder-entra",
"activated_by": "00100290", "stage": "production",
"licences": {"joule_base": "confirmed", "microsoft_365": "confirmed",
"m365_copilot_for_copilot_skills": "confirmed", "ai_units": "open"},
"status": [{"label": "GA", "source": "SAP Business AI release highlights Q4 2025",
"date": "2026-01-14"}],
"audit": ["Joule conversation history", "Microsoft 365 audit log"],
},
"M365-T": {
"kind": "joule-m365-copilot", "joule": "joule-nonprod", "entra_tenant": "calder-entra-test",
"activated_by": "00100290", "stage": "test",
"licences": {"joule_base": "confirmed", "microsoft_365": "confirmed",
"m365_copilot_for_copilot_skills": "confirmed", "ai_units": "open"},
"status": [{"label": "GA", "source": "SAP Business AI release highlights Q4 2025",
"date": "2026-01-14"}],
"audit": ["Joule conversation history", "Microsoft 365 audit log"],
},
"CS-A2A": {
"kind": "inbound-a2a", "consumer": "copilot-cs-agent", "platform": "Copilot Studio",
"activated_by": "00100292", "stage": "pilot",
"connection": "custom connector with token exchange",
"token": {"grant": "urn:ietf:params:oauth:grant-type:jwt-bearer", "resource": GATEWAY,
"aud": GATEWAY, "sub_preserved": True, "sap_user_type": "user"},
"acl": ["AGT_ORDER_EXC"],
"status": [{"label": "not GA", "source": "SAP Architecture Center, Microsoft Copilot "
"Integration with Joule Agents", "date": "2026-10-23"},
{"label": "GA (inbound A2A)", "source": "SAP Architecture Center news",
"date": "2026-10-27"}],
"audit": ["Copilot Studio transcript", "SAP Cloud ALM (Agent Gateway)"],
},
"ETA-A2A": {
"kind": "outbound-a2a", "agent": "carrier-eta-agent", "trust": "IAS App2App",
"activated_by": "00100292", "stage": "pilot",
"sync_seconds": 20, "push_notifications": True, "message_types": ["text"],
"status": [{"label": "not GA", "source": "SAP Architecture Center, Integrating AI "
"Agents with Joule (Outbound A2A)", "date": "2026-10-26"}],
"audit": ["Joule conversation history", "carrier-eta-agent log"],
},
},
"tasks": [
{"id": "T01", "ask": "Which of my orders are blocked?", "entry": "Teams",
"person": "cs.clerk@calder-pumpworks.example", "owner": "joule", "via": "M365",
"changes_sap": False},
{"id": "T02", "ask": "Summarize Hallam's emails about the credit hold", "entry": "Joule",
"person": "credit.analyst@calder-pumpworks.example", "owner": "m365-copilot", "via": "M365",
"changes_sap": False},
{"id": "T03", "ask": "Draft a reply to Hallam in Outlook", "entry": "Outlook",
"person": "credit.analyst@calder-pumpworks.example", "owner": "m365-copilot", "via": None,
"changes_sap": False},
{"id": "T04", "ask": "Release the credit block on order 1000002", "entry": "Teams",
"person": "credit.analyst@calder-pumpworks.example", "owner": "joule", "via": "M365",
"changes_sap": True, "confirm": True, "sap_role": "JOULE_CREDIT_ANALYST"},
{"id": "T05", "ask": "What is the next step on order 1000003?", "entry": "Copilot Studio agent",
"person": "cs.clerk@calder-pumpworks.example", "owner": "AGT_ORDER_EXC", "via": "CS-A2A",
"changes_sap": False},
{"id": "T06", "ask": "When does the truck for delivery 80000011 arrive?", "entry": "Joule",
"person": "logistics.planner@calder-pumpworks.example", "owner": "carrier-eta-agent",
"via": "ETA-A2A", "changes_sap": False},
],
}
def make_draft():
"""The partner's first draft, with the mistakes a review should catch."""
d = copy.deepcopy(REVIEWED)
d["joule_instances"]["joule-nonprod"]["entra_tenant"] = "calder-entra"
d["integrations"]["M365-T"]["entra_tenant"] = "calder-entra"
d["integrations"]["M365"]["licences"]["m365_copilot_for_copilot_skills"] = "not planned"
cs = d["integrations"]["CS-A2A"]
cs["connection"] = "native add agent"
cs["token"] = {"grant": "authorization_code", "resource": None, "aud": "copilot-cs-agent",
"sub_preserved": True, "sap_user_type": "user"}
cs["acl"] = []
cs["stage"] = "production"
eta = d["integrations"]["ETA-A2A"]
eta["sync_seconds"] = 90
eta["push_notifications"] = False
d["integrations"]["ETA-A2A"]["activated_by"] = None
for t in d["tasks"]:
if t["id"] == "T01":
t["owner"] = ["joule", "copilot-cs-agent"]
if t["id"] == "T04":
t.update({"owner": "copilot-cs-agent", "via": "CS-A2A", "entry": "Copilot Studio agent",
"confirm": False, "sap_role": None})
return d
def owners_of(task):
o = task["owner"]
return o if isinstance(o, list) else [o]
def review(d):
"""Return a list of (rule, verdict, object, message)."""
out = []
def add(rule, ok, obj, msg, warn=False):
out.append((rule, "OK" if ok else ("WARN" if warn else "FAIL"), obj, msg))
integ = d["integrations"]
# A01 opt-in: every integration is activated on purpose and has an owner
for iid, i in integ.items():
add("A01", bool(i.get("activated_by")), iid,
"activated by " + str(i.get("activated_by")) if i.get("activated_by")
else "no named person activated it (the integration is opt-in)")
# A02 one Microsoft Entra ID tenant per Joule environment
seen = {}
for name, j in d["joule_instances"].items():
other = seen.get(j["entra_tenant"])
add("A02", other is None, name,
f"Entra tenant {j['entra_tenant']}" + (f" already used by {other}" if other else ""))
seen.setdefault(j["entra_tenant"], name)
for iid, i in integ.items():
if i["kind"] == "joule-m365-copilot":
want = d["joule_instances"][i["joule"]]["entra_tenant"]
add("A02", i["entra_tenant"] == want, iid,
f"{i['joule']} trusts {want}, integration uses {i['entra_tenant']}")
# A03 licences
copilot_skill_tasks = [t["id"] for t in d["tasks"]
if "m365-copilot" in owners_of(t) and t["entry"] == "Joule"]
for iid, i in integ.items():
if i["kind"] != "joule-m365-copilot":
continue
lic = i["licences"]
base = lic["joule_base"] == "confirmed" and lic["microsoft_365"] == "confirmed"
add("A03", base, iid, "Joule Base and Microsoft 365 confirmed" if base
else "Joule Base or Microsoft 365 licence not confirmed")
if copilot_skill_tasks:
ok = lic["m365_copilot_for_copilot_skills"] == "confirmed"
add("A03", ok, iid, f"Copilot skills used from Joule ({', '.join(copilot_skill_tasks)}): "
f"Microsoft 365 Copilot licence {lic['m365_copilot_for_copilot_skills']}")
add("A03", lic["ai_units"] == "confirmed", iid,
f"AI Units {lic['ai_units']}: SAP's product page says they are currently required; "
"confirm with SAP", warn=True)
# A04 to A06 inbound A2A from another platform
for iid, i in integ.items():
if i["kind"] != "inbound-a2a":
continue
if i["platform"] == "Copilot Studio":
add("A04", i["connection"] == "custom connector with token exchange", iid,
f"connection: {i['connection']}")
tok = i["token"]
ok = (tok["grant"].endswith("jwt-bearer") and tok["resource"] == GATEWAY
and tok["aud"] == GATEWAY)
add("A05", ok, iid, f"grant {tok['grant']}, aud {tok['aud']}")
add("A05", tok["sub_preserved"] and tok["sap_user_type"] == "user", iid,
f"sub preserved {tok['sub_preserved']}, sap_user_type {tok['sap_user_type']}")
targets = sorted({o for t in d["tasks"] if t.get("via") == iid for o in owners_of(t)
if o.startswith("AGT_")})
missing = [a for a in targets if a not in i["acl"]]
add("A06", not missing, iid, "access@agent for " + (", ".join(i["acl"]) or "nothing")
+ (f"; missing {', '.join(missing)}" if missing else ""))
# A07 outbound A2A from Joule
for iid, i in integ.items():
if i["kind"] != "outbound-a2a":
continue
ok = i["sync_seconds"] <= 60 or i["push_notifications"]
add("A07", ok, iid, f"answers in {i['sync_seconds']} s, push notifications "
f"{'on' if i['push_notifications'] else 'off'} (Joule waits 60 s)")
add("A07", i["message_types"] == ["text"], iid, f"message types {i['message_types']}")
# A08 one owner per task; changes to SAP data stay with Joule, confirmed, under an SAP role
for t in d["tasks"]:
o = owners_of(t)
add("A08", len(o) == 1, t["id"], f"owner {' and '.join(o)}")
if t["changes_sap"]:
ok = o == ["joule"] and t.get("confirm") and t.get("sap_role")
add("A08", bool(ok), t["id"], f"changes SAP data: owner {o[0]}, confirm "
f"{t.get('confirm')}, role {t.get('sap_role')}")
# A09 production only on a path SAP labels GA; conflicting labels need SAP's answer
for iid, i in integ.items():
labels = {s["label"].split(" ")[0] for s in i["status"]}
if len(labels) > 1:
add("A09", False, iid, f"sources disagree ({'; '.join(s['label'] + ', ' + s['date'] for s in i['status'])}); "
f"stage {i['stage']}: ask SAP", warn=i["stage"] != "production")
else:
ok = i["stage"] != "production" or labels == {"GA"}
add("A09", ok, iid, f"{i['status'][0]['label']} ({i['status'][0]['date']}), stage {i['stage']}")
# A10 an audit record on both sides
for iid, i in integ.items():
add("A10", len(i.get("audit", [])) >= 2, iid, "audit: " + ", ".join(i.get("audit", [])))
return out
def trace(d, task):
"""Simulate one task hop by hop. Returns (hops, outcome)."""
hops, results = [], {(r, o): v for r, v, o, _ in review(d)}
person = d["people"][task["person"]]
o = owners_of(task)
def bad(rule, obj):
return results.get((rule, obj)) == "FAIL"
hops.append(f"{task['entry']}: {task['person']} asks \"{task['ask']}\"")
if len(o) > 1:
hops.append(f"two owners ({', '.join(o)}): the answer depends on which assistant the user opened")
return hops, "AMBIGUOUS"
owner, via = o[0], task.get("via")
if via is None:
hops.append(f"{owner} answers from Microsoft 365 data; SAP is not called")
return hops, "ANSWERED by " + owner
i = d["integrations"][via]
if i["kind"] == "joule-m365-copilot":
if bad("A02", via) or bad("A02", i["joule"]):
hops.append(f"Entra tenant {i['entra_tenant']} is trusted by more than one Joule instance")
hops.append("sign-in may land in the wrong Joule environment")
return hops, "REFUSED at identity (A02)"
hops.append(f"Microsoft Entra ID ({i['entra_tenant']}) signs the user in; "
f"SAP Cloud Identity Services ({d['joule_instances'][i['joule']]['identity_tenant']}) "
f"maps it to {person['sap_user']}")
if owner == "joule":
hops.append(f"{task['entry']} hands the request to Joule ({i['joule']}); the reply shows Joule answered")
if task["changes_sap"]:
if task["sap_role"] not in person["sap_roles"]:
return hops, f"REFUSED: {person['sap_user']} lacks {task['sap_role']}"
hops.append(f"Joule shows the change and waits for confirmation; "
f"S/4HANA checks {person['sap_user']}'s authorizations")
return hops, f"CHANGED in SAP after confirmation by {person['sap_user']}"
hops.append(f"S/4HANA answers within {person['sap_user']}'s authorizations")
return hops, "ANSWERED by joule"
hops.append("Joule routes the Microsoft 365 part to Microsoft 365 Copilot")
if i["licences"]["m365_copilot_for_copilot_skills"] != "confirmed":
return hops, "REFUSED: no Microsoft 365 Copilot licence for Copilot skills (A03)"
hops.append("Copilot reads email and Teams within the user's Microsoft 365 permissions")
return hops, "ANSWERED by m365-copilot"
if i["kind"] == "inbound-a2a":
hops.append(f"{i['platform']} agent {i['consumer']} calls the Agent Gateway over A2A")
tok = i["token"]
hops.append(f"token: grant {tok['grant'].split(':')[-1]}, aud {tok['aud']}")
if tok["aud"] != GATEWAY:
return hops, "REFUSED at Agent Gateway: wrong audience (A05)"
if owner.startswith("AGT_") and owner not in i["acl"]:
return hops, f"REFUSED at Agent Gateway: no access@agent for {owner} (A06)"
if not owner.startswith("AGT_"):
hops.append(f"{owner} changes SAP through a write tool of its own; Joule never sees it")
return hops, "UNSAFE: change outside Joule's confirmation (A08)"
hops.append(f"gateway routes to {owner}, which acts as {person['sap_user']} "
"(the user's and the agent's permissions, whichever is narrower)")
return hops, f"ANSWERED by {owner}"
if i["kind"] == "outbound-a2a":
hops.append(f"Joule calls {i['agent']} over A2A (IAS App2App trust), message/send with text")
if i["sync_seconds"] > 60 and not i["push_notifications"]:
hops.append(f"{i['agent']} needs {i['sync_seconds']} s; Joule stops waiting at 60 s")
return hops, "TIMED OUT (A07)"
hops.append(f"{i['agent']} answers in {i['sync_seconds']} s; the reply names it as the source")
return hops, f"ANSWERED by {i['agent']}"
return hops, "UNKNOWN PATH"
def owners_md(d):
lines = [f"# Assistant ownership at Calder (as of {d['as_of']})", "",
"| Task | Entry point | Owner | Path | Changes SAP | Trace result |",
"| --- | --- | --- | --- | --- | --- |"]
for t in d["tasks"]:
_, outcome = trace(d, t)
lines.append(f"| {t['id']} {t['ask']} | {t['entry']} | {' and '.join(owners_of(t))} | "
f"{t.get('via') or 'none'} | {'yes' if t['changes_sap'] else 'no'} | {outcome} |")
lines += ["", "Course stand-in. Calder Pumpworks is fictional."]
return "\n".join(lines) + "\n"
def main():
p = argparse.ArgumentParser(description=__doc__.splitlines()[0])
p.add_argument("--init", action="store_true")
p.add_argument("--force", action="store_true")
p.add_argument("--design")
p.add_argument("--review", action="store_true")
p.add_argument("--trace", action="store_true")
p.add_argument("--only")
p.add_argument("--owners", action="store_true")
a = p.parse_args()
if a.init:
for name, data in (("assistants_draft.json", make_draft()),
("assistants_reviewed.json", REVIEWED)):
f = HERE / name
if f.exists() and not a.force:
print(f"SKIP {f.name} exists (use --force to overwrite)")
continue
f.write_text(json.dumps(data, indent=2) + "\n", encoding="utf-8")
print(f"WROTE {f.name}")
return 0
if not a.design:
p.error("give --init, or --design FILE with --review, --trace or --owners")
path = Path(a.design)
if not path.exists():
print(f"MISSING {path}: run with --init first")
return 1
d = json.loads(path.read_text(encoding="utf-8"))
code = 0
if a.review:
rows = review(d)
for rule, verdict, obj, msg in rows:
print(f"{verdict:<4} {rule} {obj:<14} {msg}")
counts = {v: sum(1 for r in rows if r[1] == v) for v in ("OK", "WARN", "FAIL")}
print(f"\n{counts['OK']} OK, {counts['WARN']} WARN, {counts['FAIL']} FAIL")
code = 2 if counts["FAIL"] else 0
if a.trace:
log = HERE / "assistant_trace.jsonl"
with log.open("w", encoding="utf-8") as fh:
done = 0
for t in d["tasks"]:
if a.only and t["id"] != a.only:
continue
hops, outcome = trace(d, t)
print(f"\n{t['id']} {outcome}")
for n, h in enumerate(hops, 1):
print(f" {n}. {h}")
fh.write(json.dumps({"task": t["id"], "hops": hops, "outcome": outcome}) + "\n")
done += 1
print(f"\nwrote {done} trace(s) to {log.name}")
if a.owners:
f = HERE / "assistant_owners.md"
f.write_text(owners_md(d), encoding="utf-8")
print(f"WROTE {f.name}")
return code
if __name__ == "__main__":
sys.exit(main())
On macOS or Linux, use python3 if python isn't found. You should see:
WROTE assistants_draft.json
WROTE assistants_reviewed.json
Open unit23/assistants_reviewed.json. It has four parts: the two Joule instances with their Entra tenants, three people mapped to SAP users, four integrations (M365 and M365-T for the Microsoft 365 Copilot integration in production and test, CS-A2A for Calder's Copilot Studio agent calling the order exceptions agent, ETA-A2A for Joule calling a carrier's agent) and six tasks with one owner each.
FAIL A01 ETA-A2A no named person activated it (the integration is opt-in)
FAIL A02 joule-nonprod Entra tenant calder-entra already used by joule-prod
FAIL A03 M365 Copilot skills used from Joule (T02): Microsoft 365 Copilot licence not planned
FAIL A04 CS-A2A connection: native add agent
FAIL A05 CS-A2A grant authorization_code, aud copilot-cs-agent
FAIL A06 CS-A2A access@agent for nothing; missing AGT_ORDER_EXC
FAIL A07 ETA-A2A answers in 90 s, push notifications off (Joule waits 60 s)
FAIL A08 T01 owner joule and copilot-cs-agent
FAIL A08 T04 changes SAP data: owner copilot-cs-agent, confirm False, role None
FAIL A09 CS-A2A sources disagree (not GA, 2026-10-23; GA (inbound A2A), 2026-10-27); stage production: ask SAP
23 OK, 2 WARN, 10 FAIL
The exit code is 2. Each FAIL is a mistake a real partner draft can make: a test Joule sharing the production Entra tenant, the Copilot Studio agent added the native way so its token is meant for itself, no access list, two owners for one question, and a credit release handled outside Joule.
#Step 5: Trace the draft and see what the failures do
T01 AMBIGUOUS
T02 REFUSED: no Microsoft 365 Copilot licence for Copilot skills (A03)
T05 REFUSED at Agent Gateway: wrong audience (A05)
T06 TIMED OUT (A07)
T04, the credit release, is also refused at the gateway for the wrong audience. That hides a worse problem: fix the token and the draft's Copilot Studio agent would change SAP with its own tool, outside Joule's confirmation. The review caught it under A08 even though the trace stopped earlier. This is why you review the design, not only the traces.
The three warnings are honest open questions, not mistakes: AI Units for the two Microsoft 365 integrations are not yet confirmed with SAP, and SAP's pages disagree about the Agent Gateway's GA status, so CS-A2A stays a pilot. Task T05 now traces like this:
T05 ANSWERED by AGT_ORDER_EXC
1. Copilot Studio agent: cs.clerk@calder-pumpworks.example asks "What is the next step on order 1000003?"
2. Copilot Studio agent copilot-cs-agent calls the Agent Gateway over A2A
3. token: grant jwt-bearer, aud urn:sap:identity:application:provider:name:agent-gateway
4. gateway routes to AGT_ORDER_EXC, which acts as 00100265 (the user's and the agent's permissions, whichever is narrower)
You should see WROTE assistant_owners.md. Open it in VS Code and press Ctrl+Shift+V (Windows) or Cmd+Shift+V (macOS) to preview it. The table lists each task, its entry point, owner, path and trace result. It is the page to paste into a solution design document.
Joule and Microsoft 365 Copilot (GA per SAP's Q4 2025 highlights). Activate it as an AI feature; SAP's product page says AI Units are currently required (SAP). The page showed the offering as unavailable in the country it was read from, which may only reflect the reader's location; check availability for each country you operate in. SAP's lesson points to Discovery Center mission 4741 and the Help Portal for setup (SAP Learning). Microsoft's post adds the SAP Joule app in Microsoft Marketplace (Microsoft).
Agent Gateway for inbound A2A (GA in October 2026 per SAP's news post; "not yet GA" on the reference pages updated 23 to 27 October). Registration goes through SAP for Me and three formations (SAP Architecture Center news). The calling platform's side (custom connector, proxy agent) is the customer's to build and run.
Outbound A2A from Joule (parts not yet GA). Joule Studio agents get their scenario automatically; pro-code agents need a manual scenario and dialog function (SAP Architecture Center).
Licensing. At least three meters: SAP's (Joule, AI Units), Microsoft's (Microsoft 365, Microsoft 365 Copilot, Copilot Studio) and, for agent paths, whatever the calling platform charges. No unit prices are published on the pages read in this run.
Where it sits. Calder runs one production Joule (joule-prod in calder-ai-prod) and one non-production (joule-nonprod), as in the Unit 23 setup. Microsoft 365 sits beside them, signed in through Entra ID tenants calder-entra and calder-entra-test, each federated with the matching Cloud Identity Services tenant. The Copilot Studio agent and the carrier's agent are outside SAP; the Agent Gateway is SAP-managed.
flowchart LR
subgraph MS[Microsoft 365]
T[Teams / Copilot]
CS[Copilot Studio agent]
end
E[Entra ID] --- I[Cloud Identity Services]
T --> J[Joule]
J --> T
CS --> X[Custom connector] --> G[Agent Gateway] --> A[Joule agent]
J --> C[Carrier agent]
J --> S[S/4HANA CP10]
A --> S
Non-functional requirements.
Requirement
Typical target
What breaks if it's missed
Identity
The named user reaches SAP at every hop
Authorizations and audit attach to a shared account
Environment separation
Own Entra tenant per Joule instance
Test users land in production, or the reverse
Latency
Outside agents answer within 60 s or use push
Joule stops waiting; the user sees no answer
Availability
Each corridor's status recorded with source and date
A pilot path ends up in production unnoticed
Cost
All meters on one page
The case undercounts AI Units or Copilot licences
Integration and identity. People sign in once with Entra ID; Cloud Identity Services maps them to SAP users. In corridor 1 the product integration carries the user. In corridor 2 the caller exchanges the user's token for one whose audience is the Agent Gateway, and the gateway checks the access list. In corridor 3 Joule trusts the outside agent through IAS App2App, so the outside system decides what the user may see there. See Joule authorizations and security for what SAP checks once the request is inside.
The decision to record (ADR form from the design-doc topic):
Context: Calder's customer service works in Teams and has a Copilot Studio agent; SAP holds the orders; Joule is activated.
Options: A, Joule in Microsoft 365 Copilot only. B, A plus inbound A2A from the Copilot Studio agent to the order exceptions agent. C, the Copilot Studio agent with its own write tools into SAP. D, everything in Joule, Copilot Studio retired.
Decision: B. Every change to SAP data stays in Joule with confirmation; CS-A2A stays a pilot until SAP confirms GA under Calder's contract.
Consequences: two configurations to own (Microsoft and SAP); an ownership table to keep current; three meters in the budget.
What a design review will ask.
Which assistant owns each task, and who updates the table when a skill is added?
Show the audit record for one request from Teams: which SAP user appears?
Is the test environment on its own Entra tenant?
Which corridors are GA under our contract, and who confirmed it, when?
Can any path change SAP data without Joule's confirmation?
Security. Insist on user tokens for every call that reaches SAP data; SAP's pattern requires one for invoking an SAP agent. Treat text from the other assistant as untrusted input: an email Copilot summarizes can carry instructions meant for an agent, as prompt injection and tool poisoning shows.
Authorizations. Roles decide what a person can do from any door. Test the refusal cases from Teams as well as from Joule.
Evaluation. Keep one test set per task, run from each entry point that reaches it, and compare answers. Two doors to one owner must give the same answer.
Cost. Put all meters in one sheet and review monthly. A Copilot licence per user adds up fast if everyone gets Copilot skills inside Joule.
Operations. Support needs to know which side to look at. The audit trail spans Microsoft 365, Joule and, for agent paths, the gateway; join them by time and user.
Clean core. Nothing here changes S/4HANA. Calder-specific logic lives in a Joule agent, not in the other platform.
This whole topic is about AI assistants, so the question is narrower: what does a second assistant change? It adds one more consumer of SAP data and one more place a model can be misled. SAP delivers the routing and identity pieces; the customer owns the ownership table, the test sets and the decision of which corridors go live. Governing many agents across platforms is the subject of AI Agent Hub and agent governance and a later Unit 23 topic on agent fleets.
Calder's aftermarket team works in Amazon Quick and wants to ask the order exceptions agent about Hallam's spare-part orders. SAP's reference architecture for inbound A2A lists Amazon Quick among the platforms that consume Joule agents (SAP Architecture Center). Add that corridor, and add a test that a clerk can't release a credit block from Teams.
Copy the reviewed design:
Windows (PowerShell):Copy-Item unit23/assistants_reviewed.json unit23/assistants_exercise.json
Try one failure on purpose: remove "AGT_ORDER_EXC" from the "acl" of AFT-A2A (leave []), run the review again, see the A06 FAIL, then put it back.
Done when the review ends with 41 OK, 3 WARN, 0 FAIL, the trace shows T07 ANSWERED by AGT_ORDER_EXC and T08 REFUSED: 00100265 lacks JOULE_CREDIT_ANALYST, and assistant_owners.md lists eight tasks. Keep the file: the ownership table feeds the architect capstone's integration pack.
Pick one answer for each question. The explanation appears after you choose.
1In the reviewed design, who orchestrates task T05, and who answers it?
Answer: C. The user's door is the Copilot Studio agent, so it orchestrates and hands the SAP part over A2A. The order exceptions agent keeps the SAP logic and answers as the named user.
2Why does SAP's Copilot reference architecture use a custom connector instead of Copilot Studio's native add-agent path?
Answer: D. The Agent Gateway accepts only a token meant for it. The connector runs the jwt-bearer exchange at Cloud Identity Services, keeping the same user, and the native path can't.
3After the token exchange, which statement about the new token is right?
Answer: B. SAP's token exchange page says the audience follows the resource parameter while the subject and user type are preserved. The gateway still checks the access list for the target agent.
4The order exceptions agent acts for clerk 00100265. Which permissions apply?
Answer: B. SAP's page says an agent acting in user context gets the intersection of user and agent permissions. Neither side can reach beyond what both allow.
5In the draft, the carrier's agent needs 90 seconds and has push notifications off. What happens, and what fixes it?
Answer: D. SAP's outbound page says Joule expects a synchronous answer within 60 seconds and uses push notifications for longer tasks. Rule A07 checks exactly that.
6A partner wants the Copilot Studio agent to release credit blocks with its own SAP tool, "to keep the clerk in Teams". What do you do?
Answer: B. Rule A08 keeps every change to SAP data in Joule's confirmation under an SAP role. The clerk can stay in Teams because the integration reaches Joule from there.
7SAP's news post says inbound A2A is GA, and the reference page says the gateway is not yet GA. How should the design record it?
Answer: A. Rule A09 fails a production stage when sources disagree and warns for a pilot. A written answer from SAP for your contract settles it.
8Why does the review catch the draft's unsafe credit release when the trace doesn't show it?
Answer: C. The trace stops when the gateway refuses the token, so it never reaches the write. The review checks every rule on the design, which is why you run both.
Bi-directional integration between Joule and Microsoft 365 Copilot (sap.com product page)— read 2026-11-28, no page date; Microsoft 365 users reach SAP tasks and data through Joule, SAP users reach Microsoft 365 information through Joule; "AI Units are currently required to use this AI offering"; the page showed the offering as not available in the reader's country or region, which may reflect where it was read from
Setting Up Joule with Microsoft 365 Copilot (SAP Learning lesson)— read 2026-11-28, no date; connects the two without merging them; starts with Microsoft Teams; says whether Joule or Copilot answered; opt-in, enabled by default for neither; prerequisites: licensed Microsoft 365 Copilot environment, activated Joule, identity alignment, network and trust; points to Discovery Center mission 4741 and the Help Portal page
SAP and Microsoft 365: a unified AI experience that works where you work (Microsoft Tech Community, 27 January 2026, updated 9 February 2026)— read 2026-11-28; co-authored by Microsoft and SAP; integration generally available; Joule in Teams, Word, PowerPoint, Excel and OneNote; Joule routes to Microsoft 365 Copilot when Microsoft 365 context is relevant; needs Joule Base and a Microsoft 365 licence, a Microsoft 365 Copilot licence only for Copilot skills within Joule; set up with the SAP Joule app from Microsoft Marketplace and a connection between SAP Cloud Identity Services and Microsoft Entra ID
Enable Microsoft Copilot and Teams to pass requests to Joule (SAP Community, SAP product expert)— read 2026-11-28, no date shown; prerequisite trust between SAP Cloud Identity Services and Microsoft Entra ID; Joule keeps a 1:1 relationship with an Entra ID tenant, so a test tenant is recommended; admin consent for SAP's Teams bot app, delegated permission access_as_user, a system of type Microsoft 365 Copilot for SAP Joule added to the Joule formation
Microsoft Copilot Integration with Joule Agents (SAP Architecture Center, updated 23 October 2026)— read 2026-11-28; Copilot Studio hands an SAP task through a Power Platform custom connector that exchanges the token at SAP Cloud Identity Services, then calls the Agent Gateway; the native add-agent path can't do the exchange; the user's subject is kept so actions are attributable; says the Agent Gateway is not yet GA
Third-Party A2A Integration & Token Exchange (SAP Architecture Center, updated 13 October 2026)— read 2026-11-28; jwt-bearer token exchange at Cloud Identity Services with a resource parameter; aud follows the resource, sub and user type are kept; user types user, techUser, agentUser; in user context the effective permission is the intersection of user and agent permissions; authZ claim needs access@agent; some propagation features still in preparation