<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>iamops.dev</title>
    <link>https://iamops.dev/</link>
    <description>Practitioner notes on identity and access management, AI agents and DevOps: explainers, hands-on labs and news, with the source linked for every claim.</description>
    <language>en</language>
    <lastBuildDate>Fri, 20 Nov 2026 08:00:00 GMT</lastBuildDate>
    <generator>Astro</generator>
    <image>
      <url>https://iamops.dev/icons/icon-512.png</url>
      <title>iamops.dev</title>
      <link>https://iamops.dev/</link>
    </image>
    <atom:link href="https://iamops.dev/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Enforce downscoping in token exchange for agent-to-agent calls</title>
      <link>https://iamops.dev/enforce-downscoping-token-exchange-a2a/</link>
      <guid isPermaLink="true">https://iamops.dev/enforce-downscoping-token-exchange-a2a/</guid>
      <pubDate>Fri, 20 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>Labs</category>
      <category>Token Exchange</category>
      <category>Keycloak</category>
      <category>A2A</category>
      <category>RFC 8693</category>
      <category>AI agents</category>
      <description>A Keycloak lab for A2A agents: the token B gets for C follows B's own scopes, not A's, unless you enforce downscoping. Stock run, control run and the fix.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/enforce-downscoping-token-exchange-a2a.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>When agent B calls agent C for agent A, B swaps A's token for a new one. On Keycloak 26.8.2 the scope of that new token follows B's own scopes, not the token A handed over, unless you enforce downscoping.</li>
<li>In my run A held c.read, B held c.write as an optional scope of its own, and B's exchange returned a token for A with c.write. Agent C accepted a write that A never granted.</li>
<li>That is B using a right it has, not B breaking out. With c.write removed from B the same exchange fails with invalid_scope. This is a configuration lesson, not a vulnerability.</li>
<li>One client policy with the executor downscope-assertion-grant-enforcer bounds the exchange to A's scopes. Agent C should also require an act claim and check scope per skill.</li>
<li>I only tested Keycloak. A2A 1.0.0 leaves authorization to the implementation, and the Agent Card has no field for token exchange.</li>
</ul>
<p>A2A 1.0.0 is the current release of the Agent2Agent protocol. It says a server must authenticate every request and that authorization is up to the implementation. It does not say what happens when agent B calls agent C on behalf of agent A. That part is plain OAuth, and the usual tool is token exchange (<a href="https://www.rfc-editor.org/rfc/rfc8693">RFC 8693</a>). I built a small chain on a local Keycloak and asked one question: does the token B gets for C stay inside what A handed over?</p>
<p>It does not, unless you ask Keycloak to enforce it. This post is about that setting. If you read my <a href="https://iamops.dev/keycloak-token-exchange-rfc-8693/">first Keycloak token exchange lab</a>, this one picks up where its &quot;no act claim&quot; gotcha left off and adds delegation.</p>
<h2>What this lab shows</h2>
<p>Three agents and one authorization server, all on localhost.</p>
<ul>
<li><strong>A</strong> is the caller. It holds a token with scope <code>agent-b c.read</code>. A <code>may_act</code> claim in that token names B as the party that may act for it.</li>
<li><strong>B</strong> is an agent in the middle. It receives A's call, then asks Keycloak for a token to call C, using A's token as <code>subject_token</code> and its own token as <code>actor_token</code>.</li>
<li><strong>C</strong> is a small notes agent with a read skill and a write skill. It accepts only delegated tokens and checks the scope per skill.</li>
</ul>
<table>
<thead>
<tr>
<th>Client</th>
<th>Role</th>
<th>Scopes it can ask for in an exchange</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>agent-a</code></td>
<td>Caller, service account</td>
<td><code>agent-b</code> by default, <code>c.read</code> when it asks</td>
</tr>
<tr>
<td><code>agent-b</code></td>
<td>Middle agent, performs the exchange</td>
<td><code>c.read</code> and <code>c.write</code>, both optional</td>
</tr>
<tr>
<td><code>agent-c</code></td>
<td>Notes agent, audience only</td>
<td>none</td>
</tr>
</tbody>
</table>
<figure class="b-fig"><img src="https://iamops.dev/media/enforce-downscoping-token-exchange-a2a/00-flow.webp" alt="Sequence diagram: agent A reads the Agent Card of B, gets a token from Keycloak, calls B, and B swaps it for a delegated token with an act claim before calling C." width="1800" height="766" loading="lazy" decoding="async"><figcaption><strong>The chain.</strong> Steps 1 to 4 are A calling B. Steps 5 to 7 are B turning A's token into a delegated token. Steps 8 to 10 are the call to C.</figcaption></figure>
<p>Each agent publishes an Agent Card at <code>/.well-known/agent-card.json</code> with an <code>oauth2</code> security scheme and the scopes per skill. The scheme can say <code>clientCredentials</code> and nothing closer to token exchange: an <code>OAuthFlows</code> object holds exactly one flow, and there is no exchange flow. So C's card says it in the description text, and a caller has to read it.</p>
<h2>Setup</h2>
<p>Keycloak 26.8.2 from the zip, Java 21, development mode. Standard token exchange is on by default in 26.8. Delegation, meaning the <code>act</code> and <code>may_act</code> claims, is not. It needs two preview features.</p>
<pre><code class="language-bash">&quot;$KC_HOME/bin/kc.sh&quot; start-dev --http-port 8080 --features=token-exchange-delegation,parameterized-scopes
</code></pre>
<p>Keycloak prints the preview features it enabled at startup. I enabled the two together and did not test them one by one. Without them my chain fails: Keycloak refuses any subject token that carries <code>may_act</code> in a plain exchange, with &quot;Subject token with a delegation claim is not allowed for standard token exchange&quot;.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/enforce-downscoping-token-exchange-a2a/01-features.webp" alt="Terminal output of Keycloak 26.8.2 starting with the preview features parameterized-scopes and token-exchange-delegation enabled, followed by the realm script reporting realm a2a ready." width="1894" height="301" loading="lazy" decoding="async"><figcaption><strong>Features and realm.</strong> Keycloak 26.8.2 with two preview features on, then the realm script.</figcaption></figure>
<p>The realm script creates the three clients with service accounts, the scopes <code>agent-b</code>, <code>c.read</code> and <code>c.write</code> (each with an audience mapper), and a hard-coded <code>may_act</code> mapper on <code>agent-a</code>. It also switches on Standard Token Exchange for <code>agent-b</code> and gives <code>agent-b</code> the scopes <code>c.read</code> and <code>c.write</code> as optional client scopes. Remember that last part. The whole post turns on it.</p>
<h2>The call chain works</h2>
<p>A reads B's card, asks Keycloak for exactly the scopes the skill lists and sends <code>message:send</code>. B exchanges the token and calls C. The decoded delegated token keeps A as <code>sub</code>, narrows <code>aud</code> to C, carries only <code>c.read</code> and adds <code>act</code> for B.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/enforce-downscoping-token-exchange-a2a/02-chain.webp" alt="Terminal output of agent A reading the Agent Card of B, requesting the scopes agent-b and c.read, and getting a 200 answer from B that summarises two notes held by C." width="1894" height="263" loading="lazy" decoding="async"><figcaption><strong>The legitimate path.</strong> A asks B to summarise the notes. B exchanges A's token and reads them from C.</figcaption></figure>
<h2>The exchange that A never granted</h2>
<p>Now B asks for <code>c.write</code>. A's token has no <code>c.write</code>. This is the request, with placeholders:</p>
<pre><code class="language-bash">curl -s &quot;$KC_URL/realms/a2a/protocol/openid-connect/token&quot; \
  -d grant_type=urn:ietf:params:oauth:grant-type:token-exchange \
  -d client_id=agent-b -d &quot;client_secret=$AGENT_B_SECRET&quot; \
  -d subject_token=&quot;$A_TOKEN&quot; -d subject_token_type=urn:ietf:params:oauth:token-type:access_token \
  -d actor_token=&quot;$B_TOKEN&quot; -d actor_token_type=urn:ietf:params:oauth:token-type:access_token \
  -d audience=agent-c -d scope=c.write
</code></pre>
<p>Keycloak issues the token. <code>sub</code> is A, <code>act</code> names B, <code>scope</code> is <code>c.write</code>. C checks signature, audience, the <code>act</code> claim and the scope its write skill needs, and adds the note.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/enforce-downscoping-token-exchange-a2a/03-stock.webp" alt="Terminal output on stock Keycloak: agent B lists c.write among its optional scopes, A's token has scope agent-b c.read, the token B gets for agent C has scope c.write with act agent-b, and C answers that the note was added." width="1894" height="1218" loading="lazy" decoding="async"><figcaption><strong>Stock Keycloak.</strong> A's token says c.read. The token for C says c.write. C adds the note. Ids are replaced by placeholders.</figcaption></figure>
<p>I ran the whole sequence four times on a fresh Keycloak 26.8.2, twice with the lab scripts and twice with the ones in this post, and got the same result each time.</p>
<h2>The control: B holds c.write</h2>
<p>Before calling this an escalation I checked whose right is being used. In my realm B holds <code>c.write</code> as an optional scope of its own. I put it there. So B did not get something it was never allowed to have. I removed <code>c.write</code> from B's optional scopes and ran the same exchange.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/enforce-downscoping-token-exchange-a2a/04-control.webp" alt="Terminal output of the control run: after c.write is deleted from the optional client scopes of agent B, the same exchange is refused with invalid_scope, Invalid scopes: c.write." width="1894" height="225" loading="lazy" decoding="async"><figcaption><strong>The control.</strong> Without c.write on B, nothing is issued. B stays inside its own rights.</figcaption></figure>
<p>That settles one thing. B cannot go beyond what it holds itself, and nothing here is a bug in the sense of a bypass. What went missing is something else: the scope of the new token is bounded by B's scope pool and not by A's token. A said &quot;read&quot;, and that stopped meaning anything one hop later. RFC 8693 leaves this to the server: <code>scope</code> is &quot;the desired scope of the requested security token&quot; and its values are &quot;service specific&quot; (<a href="https://www.rfc-editor.org/rfc/rfc8693#section-2.1">section 2.1</a>). Nothing requires the result to be a subset of the subject token.</p>
<p>It matters for agents because C logs <code>sub</code> A and <code>act</code> B. Whoever reads the log sees &quot;A wrote a note&quot;. A never agreed to that.</p>
<h2>Bound the exchange with the downscope policy</h2>
<p>Keycloak has a client policy executor for exactly this: <code>downscope-assertion-grant-enforcer</code>. It limits the scopes of the new token to those already in the subject token and answers <code>invalid_scope</code> otherwise. It takes no configuration. I applied it to every client in the realm with one policy.</p>
<pre><code class="language-json">{&quot;profiles&quot;:[{&quot;name&quot;:&quot;downscope-only&quot;,&quot;description&quot;:&quot;exchange can narrow, never widen&quot;,
  &quot;executors&quot;:[{&quot;executor&quot;:&quot;downscope-assertion-grant-enforcer&quot;,&quot;configuration&quot;:{}}]}]}
</code></pre>
<p>With <code>c.write</code> back on B and the policy on, the exchange is refused. The legitimate <code>c.read</code> exchange still works.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/enforce-downscoping-token-exchange-a2a/05-enforcer.webp" alt="Terminal output with the downscope policy active: the c.write exchange is refused because c.write is not present in the initial access token, and the c.read exchange still returns a delegated token that C accepts." width="1894" height="836" loading="lazy" decoding="async"><figcaption><strong>With the policy.</strong> c.write is refused because A's token does not carry it. c.read still works. C lists the note from the stock run too.</figcaption></figure>
<p>The last line of that output is the note that the stock run added. It stays until you restart C.</p>
<h2>What C should check as well</h2>
<p>The policy lives on the authorization server. C should not depend on it alone.</p>
<ul>
<li>Require the <code>act</code> claim and check <code>act.client_id</code> against the agents you expect. My C answers 403 without it.</li>
<li>Check the scope per skill. My C needs <code>c.read</code> to read and <code>c.write</code> to write.</li>
<li>Check <code>aud</code>. A token for B is refused at C with 401.</li>
<li>Do not treat <code>may_act</code> as proof. When B presented C's token as the actor, Keycloak refused with an audience message. I did not isolate whether it compares the actor with <code>may_act</code>.</li>
</ul>
<h2>Gotchas</h2>
<ul>
<li><strong>The enforcer and a client-level audience mapper.</strong> My first setup put C's audience in a mapper on client B. With the enforcer on, every exchange then failed with &quot;Requested audience not available: agent-c&quot;. Moving the mapper to the <code>c.read</code> and <code>c.write</code> scopes fixed it. I do not know why. Test it in your own realm.</li>
<li><strong>Audience by scope has a side effect.</strong> <code>c.read</code> carries C's audience, so A's own token gets <code>aud</code> B and C. The thing that stops A from using it at C is the <code>act</code> requirement, not the audience.</li>
<li><strong>The wrong-actor error is vague.</strong> The client sees <code>access_denied</code> and &quot;Client is not within the token audience&quot;. The Keycloak event log names the actor.</li>
<li><strong><code>may_act</code> is hard-coded in my realm.</strong> In a real system it should come from policy and live with the token.</li>
</ul>
<h2>What was not run</h2>
<p>I only ran Keycloak 26.8.2. I did not test Entra on-behalf-of, Okta or Auth0, so I make no claim about how they bound scope in an exchange. One hop of delegation only: no nested <code>act</code> chain. No tasks, streaming or signed Agent Cards, no TLS and no sender-constrained tokens. No user in the chain: the subject is agent A's service account. The agents are my own Flask programs, and their client secrets are static lab values.</p>
<p><em>Terminal images were rendered from the saved output of the runs, with ids replaced by placeholders. Nothing here is a real credential.</em></p>
<p>For the standards behind it, see <a href="https://iamops.dev/id-jag-explained/">ID-JAG explained</a> and <a href="https://iamops.dev/mcp-server-no-token-passthrough/">why an MCP server must not pass tokens through</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>GitHub Actions to Azure with workload identity federation: which runs get a token, and why</title>
      <link>https://iamops.dev/github-actions-azure-workload-identity-federation/</link>
      <guid isPermaLink="true">https://iamops.dev/github-actions-azure-workload-identity-federation/</guid>
      <pubDate>Fri, 20 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>Labs</category>
      <category>GitHub Actions</category>
      <category>OIDC</category>
      <category>Entra ID</category>
      <category>Workload identity</category>
      <category>Azure</category>
      <description>Lab: a GitHub workflow signs in to Azure with no secret. I print the sub of six kinds of run and show which credential lets each one in, pull requests too.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/github-actions-azure-workload-identity-federation.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>A GitHub workflow can sign in to Azure with no client secret. GitHub signs a short-lived token, and an Entra federated credential trusts one exact sub claim.</li>
<li>New repositories send an immutable sub with the owner and repository IDs in it. Create the repository first, read the IDs, then write the credential.</li>
<li>With only a credential for main, 1 of 6 kinds of run passed. An environment credential, a pull_request credential and two wildcard expressions made it 6 of 6.</li>
<li>pull_request and pull_request_target send the same sub, so a pull_request credential also trusts pull_request_target jobs, which run with secrets. Never check out the PR head there.</li>
<li>Fork pull requests were not tested. By GitHub's docs they get no write permissions, so I expect no token, but I have not seen it.</li>
</ul>
<p>A deployment pipeline with a client secret in it is a secret waiting to leak. GitHub Actions can sign in to Azure without one: GitHub signs a short-lived OIDC token for the job, and Entra trusts it through a federated credential. Two things changed this year. Since 15 July 2026, new repositories get an <a href="https://github.blog/changelog/2026-04-23-immutable-subject-claims-for-github-actions-oidc-tokens/">immutable sub claim</a> with the owner and repository IDs in it, and Entra's wildcard credentials are still in preview. I wrote up both in a <a href="https://iamops.dev/workload-identity-news-immutable-sub-entra-wildcards-workos/">news post</a>. This lab is the hands-on side.</p>
<h2>What this lab shows</h2>
<p>One app registration with Reader on one empty resource group, one private repository, no secret anywhere. The lab:</p>
<ol>
<li>Trusts the main branch with one exact credential and sees <code>azure/login</code> succeed.</li>
<li>Pushes a feature branch and opens a pull request, and sees both refused with AADSTS700213.</li>
<li>Allows <code>release/*</code> with a claims-matching expression.</li>
<li>Prints the exact <code>sub</code> for six kinds of run, then adds the credentials that make each one pass.</li>
<li>Looks at pull requests from forks, from the docs only, because I could not test them.</li>
</ol>
<h2>Setup</h2>
<p>Use a throwaway tenant and subscription, and a GitHub account that is yours. The app registration gets Reader on one empty resource group, so a working login proves the federation and nothing else. The three IDs the workflow needs (client, tenant, subscription) are not secrets, so they go into repository variables.</p>
<p>Create the repository before the credential. A new repository sends <code>repo:&lt;owner&gt;@&lt;owner-id&gt;/&lt;repo&gt;@&lt;repo-id&gt;:...</code>, and you only know the two IDs once the repository exists. A subject written the classic way, <code>repo:&lt;owner&gt;/&lt;repo&gt;:ref:refs/heads/main</code>, no longer matches.</p>
<pre><code class="language-json">{&quot;name&quot;: &quot;gh-main&quot;, &quot;issuer&quot;: &quot;https://token.actions.githubusercontent.com&quot;,
 &quot;subject&quot;: &quot;repo:&lt;github-user&gt;@&lt;owner-id&gt;/lab-b1-gh-wif@&lt;repo-id&gt;:ref:refs/heads/main&quot;,
 &quot;audiences&quot;: [&quot;api://AzureADTokenExchange&quot;]}
</code></pre>
<h2>The run</h2>
<p><strong>main logs in.</strong> The workflow prints the claims GitHub presents, then runs <code>azure/login</code> and lists resource groups. My first run failed after the login with &quot;No subscriptions found&quot;, because the Reader role had not propagated yet. A one-minute wait fixed it.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/github-actions-azure-workload-identity-federation/01-main.webp" alt="Terminal output: the gh-main federated credential with an exact subject for the main branch, then a run on main that finishes with success, prints the same sub claim, lists the resource group and shows it is signed in as a service principal. IDs are placeholders." width="1894" height="492" loading="lazy" decoding="async"><figcaption><strong>The sub matches character for character.</strong> The credential is the whole trust relationship. There is no secret to create and nothing to rotate. IDs are placeholders.</figcaption></figure>
<p><strong>A feature branch and a pull request are refused.</strong> Same workflow, different <code>sub</code>. Entra answers AADSTS700213 and the message names the subject it got, which is the fastest way to debug a credential.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/github-actions-azure-workload-identity-federation/02-feature-refused.webp" alt="Terminal output: a push to feature-x and a pull request both finish with failure and AADSTS700213, no matching federated identity record. The presented subjects end in ref:refs/heads/feature-x and pull_request. IDs are placeholders." width="1894" height="454" loading="lazy" decoding="async"><figcaption><strong>Refused, by design.</strong> A typo in a branch name or an unreviewed pull request does not get the deployment identity. IDs are placeholders.</figcaption></figure>
<p><em><em>release/</em> with an expression.</em>* A flexible federated credential holds a <code>claimsMatchingExpression</code> instead of a subject. For app registrations I created it through the Graph beta endpoint with <code>az rest</code>. I followed Microsoft's doc and pinned <code>repository_id</code> as well:</p>
<pre><code class="language-text">claims['sub'] matches 'repo:&lt;github-user&gt;@&lt;owner-id&gt;/lab-b1-gh-wif@&lt;repo-id&gt;:ref:refs/heads/release/*' and claims['repository_id'] eq '&lt;repo-id&gt;'
</code></pre>
<figure class="b-fig"><img src="https://iamops.dev/media/github-actions-azure-workload-identity-federation/03-release-expression.webp" alt="Terminal output: az rest creates the gh-release credential with a claims-matching expression on sub for release branches plus a repository_id check, then a push to release/1 finishes with success and prints its sub. IDs are placeholders." width="1894" height="492" loading="lazy" decoding="async"><figcaption><strong>One credential for a family of branches.</strong> The pattern keeps the owner and repository IDs, and repository_id is checked on its own. IDs are placeholders.</figcaption></figure>
<h2>Deeper check: the sub for every kind of run</h2>
<p>A reader asked whether refusing a feature branch and a pull request is a bug. It is not, and I wanted to show it. A small script, <code>probe.sh</code>, asks GitHub for a token, decodes the <code>sub</code>, offers the token to Entra and prints one result line. The workflow runs it on a push to main, a push to a feature branch, <code>pull_request</code>, <code>pull_request_target</code>, a tag push, and a second job that uses an environment. I used a new app and the same private repository.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/github-actions-azure-workload-identity-federation/04-subs-before.webp" alt="Terminal output: a table of six runs with only the main credential. main passes. The feature branch, pull request, pull_request_target, tag and environment runs fail with AADSTS700213. Each row shows the sub after the repository prefix." width="1894" height="416" loading="lazy" decoding="async"><figcaption><strong>1 of 6 passes.</strong> The part after the IDs is different for each kind of run, and a credential for main matches only main.</figcaption></figure>
<p>Then I added four credentials: an exact one for the environment, an exact one for <code>pull_request</code>, and two expressions for <code>feature-*</code> branches and <code>v*</code> tags. I re-ran the same runs.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/github-actions-azure-workload-identity-federation/05-subs-after.webp" alt="Terminal output: the four extra credentials listed by name and pattern, then the same table of six runs where every row passes. The prefix placeholder stands for the repository part of the sub with owner and repository IDs." width="1894" height="568" loading="lazy" decoding="async"><figcaption><strong>6 of 6 pass.</strong> &lt;prefix&gt; stands for repo:&lt;owner&gt;@&lt;id&gt;/&lt;repo&gt;@&lt;id&gt;. A credential holds either an exact subject or an expression, never both.</figcaption></figure>
<table>
<thead>
<tr>
<th>Run</th>
<th><code>sub</code> after the repository prefix</th>
<th>Credential that makes it pass</th>
<th>Only main</th>
<th>After</th>
</tr>
</thead>
<tbody>
<tr>
<td>Push to main</td>
<td><code>ref:refs/heads/main</code></td>
<td>Exact subject</td>
<td>Pass</td>
<td>Pass</td>
</tr>
<tr>
<td>Push to feature-probe</td>
<td><code>ref:refs/heads/feature-probe</code></td>
<td>Expression <code>...ref:refs/heads/feature-*</code></td>
<td>AADSTS700213</td>
<td>Pass</td>
</tr>
<tr>
<td><code>pull_request</code></td>
<td><code>pull_request</code></td>
<td>Exact subject</td>
<td>AADSTS700213</td>
<td>Pass</td>
</tr>
<tr>
<td><code>pull_request_target</code></td>
<td><code>pull_request</code></td>
<td>The same <code>pull_request</code> credential</td>
<td>AADSTS700213</td>
<td>Pass</td>
</tr>
<tr>
<td>Tag v1</td>
<td><code>ref:refs/tags/v1</code></td>
<td>Expression <code>...ref:refs/tags/v*</code></td>
<td>AADSTS700213</td>
<td>Pass</td>
</tr>
<tr>
<td>Job with environment lab-b1-prod</td>
<td><code>environment:lab-b1-prod</code></td>
<td>Exact subject</td>
<td>AADSTS700213</td>
<td>Pass</td>
</tr>
</tbody>
</table>
<p><strong>A difference from Microsoft's doc.</strong> The <code>feature-*</code> and <code>v*</code> expressions had only a <code>sub</code> clause, with no <code>repository_id</code>. Entra accepted both and the runs passed. My patterns had the owner and repository IDs inside them, so they were pinned anyway. In a later check the same day, Entra also accepted an owner-wide expression with no <code>repository_id</code> or <code>repository_owner_id</code> clause, and that credential issued a token to a different repository of the same owner. Microsoft's pages say a GitHub expression must match <code>sub</code> and <code>repository_id</code> or <code>repository_owner_id</code>. I still recommend adding <code>repository_id</code> to every expression. The rule is documented and the feature is in preview, so a sub-only credential may be refused or stop matching later. And the ID check does not depend on writing the pattern right: an owner-wide wildcard already issued a token to another of my repositories, and a name-only <code>sub</code> of an older repository can match a name you no longer own.</p>
<h2>pull_request and pull_request_target share one subject</h2>
<p>Both events send <code>sub</code> ending in <code>pull_request</code>, whatever the branch. So a <code>pull_request</code> credential in Entra also trusts <code>pull_request_target</code> jobs. Those run from the base branch, with secrets and with an OIDC token. If such a workflow checks out the pull request head, the author of the pull request runs code with your cloud identity. My probe workflow used the default checkout, which takes the base branch. Do not change that in a workflow that can get a token.</p>
<p>A job that uses an environment is the other surprise. It sends <code>environment:&lt;name&gt;</code> instead of the branch. Moving a deploy job into an environment breaks a credential written for main.</p>
<h2>Fork pull requests: from the docs, not tested</h2>
<p>I did not test a pull request from a fork. That needs a second GitHub account, and I will not use one that is not mine. What follows is GitHub's documentation and my reading of it.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/github-actions-azure-workload-identity-federation/06-forks-docs.webp" alt="Terminal output of three sentences quoted from GitHub's docs: secrets are not passed to workflows triggered from forks, the GITHUB_TOKEN is read-only in pull requests from forks, and write permissions are lowered to read for pull request events other than pull_request_target from a fork." width="1894" height="416" loading="lazy" decoding="async"><figcaption><strong>Docs only, not a test.</strong> The lines are printed straight from GitHub's pages so you can check the wording.</figcaption></figure>
<p><code>id-token: write</code> is a write permission. For a <code>pull_request</code> from a fork it is lowered to read, so my reading is that the job gets no OIDC token at all. <code>probe.sh</code> handles that case and would print &quot;no OIDC token was offered&quot;. I have not seen it happen. <code>pull_request_target</code> is the exception in those docs, and that is the trap above.</p>
<h2>Gotchas</h2>
<ul>
<li><strong>Read the <code>sub</code> from a real run before you write a credential.</strong> The log line and the AADSTS700213 message both show it.</li>
<li><strong>Wait after the role assignment.</strong> Without the wait, the login worked and the next command failed with &quot;No subscriptions found&quot;.</li>
<li><strong>Expressions are preview and Graph beta.</strong> For app registrations I used <code>az rest</code>. Microsoft's concept page says the CLI has no explicit support yet, while <code>az identity federated-credential</code> (user-assigned managed identities) lists preview parameters for it.</li>
<li><strong>Old repositories keep the name-only <code>sub</code></strong> until someone opts in. Write the credential for the format the repository really sends.</li>
</ul>
<h2>Security takeaways</h2>
<ol>
<li>Use federation instead of a client secret in CI. There is nothing to store, leak or rotate.</li>
<li>Use the narrowest credential that fits: exact for main and for an environment, an expression only for a real family of refs.</li>
<li>Keep the owner and repository IDs in every subject and pattern, and add <code>repository_id</code> to every expression.</li>
<li>Treat a <code>pull_request</code> credential as also trusting <code>pull_request_target</code>. Never check out untrusted code in a workflow that can get a token.</li>
<li>Delete credentials whose repository is gone. With the old name-only format, someone else can claim the name.</li>
</ol>
<h2>Clean up</h2>
<p>I deleted the app registration, which removes its credentials, deleted the resource group, checked both were gone and archived the private repository. After the deeper check I also removed the extra app, the branch, the tag, the pull request, the environment and the variables.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/github-actions-azure-workload-identity-federation/07-cleanup.webp" alt="Terminal output: the app registration and the resource group are deleted, az group exists prints false, the app list count is 0, and the repository is archived." width="1894" height="377" loading="lazy" decoding="async"><figcaption><strong>Nothing left running.</strong> No secret was ever created, so there is nothing to revoke.</figcaption></figure>
<h2>What was not run</h2>
<ul>
<li>A pull request from a fork. That part rests on GitHub's docs.</li>
<li>An existing repository opted in to the immutable format, and GitHub's preview endpoint for the subject prefix.</li>
<li>A role that can deploy. The app only had Reader on one empty resource group.</li>
<li>An expression with <code>repository_owner_id</code> or <code>job_workflow_ref</code>.</li>
<li>Other clouds. GitHub documents AWS, Google Cloud and Vault, and I only ran Azure.</li>
</ul>
<p><em>Run on 20 November 2026 with the Azure CLI, the GitHub CLI and <code>azure/login@v2</code> on a GitHub-hosted runner, in a throwaway tenant and a private repository. Terminal images were re-rendered from the saved output, with users, IDs and timestamps replaced by placeholders.</em></p>
]]></content:encoded>
    </item>
    <item>
      <title>IETF 127 notes: ID-JAG, workload grants and transaction tokens for agent delegation</title>
      <link>https://iamops.dev/ietf-127-id-jag-workload-grants-transaction-tokens/</link>
      <guid isPermaLink="true">https://iamops.dev/ietf-127-id-jag-workload-grants-transaction-tokens/</guid>
      <pubDate>Fri, 20 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>News</category>
      <category>IETF 127</category>
      <category>ID-JAG</category>
      <category>Workload identity</category>
      <category>Transaction Tokens</category>
      <category>AI agents</category>
      <category>Standards</category>
      <description>My reading of the IETF 127 OAuth and WIMSE sessions: ID-JAG, the Workload Authorization Grant, transaction tokens and actors, with draft revisions.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/ietf-127-id-jag-workload-grants-transaction-tokens.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>IETF 127 treated agent delegation as three cases: a user (ID-JAG), a workload acting for itself (Workload Authorization Grant, WAG) and a transaction in progress (a transaction-token grant).</li>
<li>ID-JAG is at draft -06 and still an OAuth working group document. Just-in-time provisioning and key binding are moving to separate drafts, and gateways in the middle are the open problem.</li>
<li>WAG, the transaction-token profile, Transactional Access Tokens, the Actor Profile and the three newest delegation drafts are individual drafts. Nothing in them is adopted or final.</li>
<li>For your own designs: classify each agent flow by who the principal is, never forward the inbound token to the next hop, and write the draft revision into any design that depends on one.</li>
</ul>
<p>IETF 127 met in San Francisco this week. I did not attend. I read the slides, the volunteer meeting notes and the current drafts for the OAuth and WIMSE sessions, and I checked every draft name and revision on datatracker.ietf.org on 20 November 2026.</p>
<p>The OAuth session was on Wednesday 18 November. WIMSE met that evening (22:00 UTC), and the joint OAuth and WIMSE session followed on Thursday 19 November. OAuth has one more session today, which has not happened as I write this. I quote the notes as notes. They are not decisions.</p>
<h2>Three grants for three kinds of principal</h2>
<p>In the joint session, Justin Richer proposed a simple taxonomy, recorded in the <a href="https://notes.ietf.org/notes-ietf-127-wimse">WIMSE notes</a>: ID-JAG is about a person, WAG is about a workload, and &quot;TAG&quot; is about a transaction in progress. &quot;TAG&quot; is a nickname from the discussion. It is not a draft or a registered name.</p>
<table>
<thead>
<tr>
<th>Case</th>
<th>Draft I checked</th>
<th>Where it stands</th>
</tr>
</thead>
<tbody>
<tr>
<td>A user</td>
<td><a href="https://datatracker.ietf.org/doc/draft-ietf-oauth-identity-assertion-authz-grant/">draft-ietf-oauth-identity-assertion-authz-grant-06</a> (ID-JAG)</td>
<td>OAuth working group document, posted 31 Oct 2026</td>
</tr>
<tr>
<td>A workload acting for itself</td>
<td><a href="https://datatracker.ietf.org/doc/draft-carleton-workload-authz-grant/">draft-carleton-workload-authz-grant-02</a> (WAG)</td>
<td>Individual draft, &quot;Informational&quot;, posted 2 Nov 2026</td>
</tr>
<tr>
<td>A transaction in progress</td>
<td><a href="https://datatracker.ietf.org/doc/draft-fletcher-oauth-txn-token-chaining-profile/">draft-fletcher-oauth-txn-token-chaining-profile-01</a></td>
<td>Individual draft, posted 26 Oct 2026</td>
</tr>
</tbody>
</table>
<p>ID-JAG and the transaction-token profile are both profiles of <a href="https://datatracker.ietf.org/doc/draft-ietf-oauth-identity-chaining/">identity chaining</a>. That draft is at -17 and the datatracker shows it in the RFC Editor queue, with the status &quot;blocked: Final Approval Pending&quot;. The WIMSE notes call it &quot;RFC 10092 (to be)&quot;. The datatracker shows no RFC number yet, so I would not quote one.</p>
<figure class="b-fig"><img src="https://iamops.dev/img/ietf-127-id-jag-workload-grants-transaction-tokens.svg" alt="Three columns, one per kind of principal. A user maps to ID-JAG, an OAuth working group document. A workload maps to WAG, an individual draft. A transaction maps to the txn-token chaining profile, an individual draft. All three lead to an authorization server that issues a token whose audience is the next API." width="1200" height="630" loading="lazy" decoding="async"><figcaption><strong>Three principals, three grants.</strong> This is my own summary of the split, not a figure from the slides. Status as of 20 November 2026.</figcaption></figure>
<h2>ID-JAG at draft -06</h2>
<p>The ID-JAG slides list what changed in -05 and -06. These are the ones I would read first:</p>
<ul>
<li>A key-bound ID-JAG can replace client authentication at the resource authorization server.</li>
<li>Token exchange is limited to a single audience. An unknown audience gets <code>invalid_target</code>.</li>
<li>mTLS binding was added, and a DPoP-bound ID-JAG requires the <code>jwt-dpop</code> grant type.</li>
<li>A new Subject Identifier Mapping section, tenant checks, and an <code>id_jag_signing_alg_values_supported</code> metadata value.</li>
<li>A Privacy Considerations section.</li>
</ul>
<p>The <a href="https://datatracker.ietf.org/meeting/127/materials/slides-127-oauth-sessa-identity-assertion-jwt-authorization-grant-00">slides</a> also list who implements it. The list includes Okta, Ping, Auth0, Descope, Keycloak, WorkOS and Oracle OCI IAM. If you want the basics first, I wrote them up in <a href="https://iamops.dev/id-jag-explained/">ID-JAG explained</a>.</p>
<p>Three themes came out of implementation experience, and each one went somewhere other than the core draft:</p>
<ul>
<li><strong>Just-in-time provisioning</strong> (issues #83 and #121). The recommendation is a future extension. An app may now meet a user for the first time through an ID-JAG, and custom claims are allowed but not necessarily interoperable.</li>
<li><strong>Key binding</strong> (issue #103). The slides list the missing pieces as <a href="https://datatracker.ietf.org/doc/draft-mcguinness-oauth-token-exchange-cnf/">draft-mcguinness-oauth-token-exchange-cnf</a> and <a href="https://datatracker.ietf.org/doc/draft-parecki-oauth-jwt-dpop-grant/">draft-parecki-oauth-jwt-dpop-grant</a>, and ask whether to pull key binding into its own extension. In the notes, Hannes said that punting to other documents leaves the draft looking undone. Aaron Parecki answered that provisioning is optional and that binding applies more widely than ID-JAG.</li>
<li><strong>Gateways and proxies</strong> (issue #114). A gateway in the middle performs the token exchange, but the ID token's audience is the client that called the gateway, so the audience check fails. The slides suggest declaring intermediaries out of scope and point to <a href="https://datatracker.ietf.org/doc/draft-mcguinness-oauth-id-continuation-assertion/">draft-mcguinness-oauth-id-continuation-assertion</a> as an extension.</li>
</ul>
<p>The authors asked for interim meetings on gateways and on key binding. The next steps on the slides are to triage the remaining issues into -07 or an explicit deferral, and then to ask for working group last call.</p>
<p>My opinion: the core grant looks stable enough to build against. I would not build a gateway-in-the-middle design on it yet, because that is the one case the authors themselves moved out.</p>
<h2>WAG: the workload version</h2>
<p>The WAG draft describes a platform whose workload identity provider signs an <a href="https://www.rfc-editor.org/rfc/rfc7523">RFC 7523</a> JWT grant that names one workload. A third party's authorization server is configured once to trust that provider and does not reject a workload because it has not seen it before. The draft says an AI agent is the motivating case, and that access on behalf of a user is out of scope.</p>
<p>It also says plainly that it is an early, exploratory individual draft and not a working group document. At the WIMSE session, Aaron Parecki said ID-JAG is fundamentally about a user, and without a user the case looks like WAG. Jeff Lombardo said he was very supportive of adoption. Karl McGuinness argued for keeping the principal types separate instead of making the receiver infer them from claims. The notes record no objection to the idea. They do not record an adoption call either.</p>
<p>Client identity came up too. Justin Richer's talk <a href="https://datatracker.ietf.org/meeting/127/materials/slides-127-wimse-sessb-the-future-of-client-id-00">The Future of Client ID</a> listed the options as dynamic registration, a metadata URL (CIMD), a client ID as a JWT, and a SPIFFE ID. The <a href="https://datatracker.ietf.org/doc/draft-ietf-oauth-spiffe-client-auth/">SPIFFE client authentication</a> draft is at -03 (2 November) and covers the token endpoint only.</p>
<p>Two other WIMSE items matter if you build on these:</p>
<ul>
<li><strong>Workload Proof Token</strong> (<a href="https://datatracker.ietf.org/doc/draft-ietf-wimse-wpt/">draft-ietf-wimse-wpt-02</a>) moved the proof into the <code>Authorization</code> header. A request has one such header, so a WPT cannot travel with an OAuth access token. Flemming Andreasen called the change inconsistent with the architecture, and Jonathan Rosenberg pointed out that an agent acting for a user needs both an access token and agent authentication. The chair sent the question to the list.</li>
<li><strong>WIMSE Architecture</strong> (<a href="https://datatracker.ietf.org/doc/draft-ietf-wimse-arch/">-09</a>) appeared on 17 November (UTC). The authors think it is ready, and the chairs plan a working group last call in the next few weeks.</li>
</ul>
<p>In the same session Brian Campbell presented the <a href="https://datatracker.ietf.org/doc/draft-ietf-wimse-aims/">AI Identity Management System</a> draft, with the line &quot;OAuth in the front, WIMSE in the back&quot;. The notes say it defines no new protocol behavior.</p>
<h2>Transaction tokens across a boundary</h2>
<p>Transaction Tokens stay inside one trust domain. <a href="https://datatracker.ietf.org/doc/draft-fletcher-oauth-txn-token-chaining-profile/">George Fletcher's profile</a> describes how a workload swaps its Txn-Token at its own authorization server for a Txn-Token-JAG (<code>typ</code> of <code>txn-chain+jwt</code>) and presents that to a partner's server. Per the <a href="https://datatracker.ietf.org/meeting/127/materials/slides-127-wimse-ietf-127-txn-token-chaining-profile-00">slides</a>, the grant lives at most 300 seconds, with 60 preferred, the <code>jti</code> is single-use, and the internal call chain never crosses the boundary. The open questions are whether sender constraining should move from SHOULD to MUST, and how to map the subject.</p>
<p>The discussion was the interesting part:</p>
<ul>
<li>Max Gerber asked why a new JAG type is needed when ID-JAG and WAG exist. Justin Richer and Pieter Kasselman answered that the input artifact is different and the JAG would carry a redacted subset of its claims.</li>
<li>Mark Atwood said stripping internal identifiers before a token crosses a boundary should be a MUST. Antoine Fressancourt replied that identifiers still have to be reconstructable for audit.</li>
<li>Arndt Schwenkschuster worried that transaction tokens become &quot;the new bearer AT&quot; that can be stolen and exchanged. George Fletcher said they are orthogonal to client authentication.</li>
<li>Justin Richer: &quot;Semantically, the transaction token shouldn't contain authorization to do work, it should shape work being done.&quot;</li>
</ul>
<p>The notes close with broad agreement that the work fills a real gap. One housekeeping point: the notes link an older name, <code>draft-fletcher-transaction-token-chaining-profile</code>. The datatracker shows that name as replaced by the <code>oauth-txn</code> one linked above, which is also what the slides use.</p>
<p><a href="https://datatracker.ietf.org/doc/draft-tulshi-oauth-transactional-access-tokens/">Transactional Access Tokens</a> (-01, dated 18 November) take a different route. A Txn-AT is a JWT access token that follows <a href="https://www.rfc-editor.org/rfc/rfc9068">RFC 9068</a> with a transaction identifier and context, for one resource server, requested through Rich Authorization Requests. The lifetime SHOULD NOT exceed 300 seconds. Token exchange, refresh and client credentials can issue it, authorization code cannot. In the session, a participant named George said there is no need to standardize it, and the author said a standard way is desirable. Justin Richer sent the discussion to the list.</p>
<h2>Who the actor is</h2>
<p>The <a href="https://datatracker.ietf.org/doc/draft-mcguinness-oauth-actor-profile/">OAuth Actor Profile for Delegation</a> (-01, 9 October) profiles the <code>act</code> claim from token exchange, asks for issuer-scoped actor identifiers and classifies actors with <code>sub_profile</code>. Karl McGuinness's summary in the notes: make delegation explicit, and the client ID stays the client. Two people spoke for adoption. Another participant said it is not a short piece of work, and Justin Richer thought it was reasonable to seek clarification before adoption. The notes record that the chairs asked for a sense of the room but not what the room said.</p>
<p>A new individual draft goes a step further. <a href="https://datatracker.ietf.org/doc/draft-nandakumar-oauth-actor-bound-token-exchange/">Token Exchange with Actor-Bound Tokens</a> (-00, 16 November) lets an orchestrator ask for a token bound to the key of the agent that will do the work. The actor proves possession of that key, so the token works only for that agent. It is an individual draft.</p>
<h2>Three more drafts from this week</h2>
<p>All three are individual -00 drafts with no working group status.</p>
<ul>
<li><a href="https://datatracker.ietf.org/doc/draft-nandakumar-oauth-delegation-revocation/">Security Events for Revocation of Agent Delegations</a> (19 Nov). A Security Event Token that revokes a delegation and everything delegated from it, with rules for how agents pass it down the chain, including over a Shared Signals stream. Token Status Lists stay the per-token status mechanism.</li>
<li><a href="https://datatracker.ietf.org/doc/draft-sweeney-oauth-brokered-authorization/">OAuth Brokered Authorization</a> (20 Nov). One durable broker is the OAuth client of the upstream resource. Each short-lived instance gets a sender-constrained token (<a href="https://iamops.dev/tools/dpop/">DPoP</a> or mTLS) for the broker through client credentials, with an <code>authorization_details</code> type of <code>brokered_access</code>. An instance never holds a refresh token.</li>
<li><a href="https://datatracker.ietf.org/doc/draft-zehavi-oauth-aud-bound-authz/">OAuth 2.0 Audience-Bound Client Authorization</a> (18 Nov). Only a client that represents the token's audience may exchange or introspect it. The link can come from local policy, from a <code>private_key_jwt</code> checked against the resource's <code>jwks_uri</code>, or from a new <code>resource_clients</code> parameter in RFC 9728 metadata. Friday's agenda lists the same author's earlier draft, <code>draft-zehavi-oauth-audience-bound-token-exchange-00</code>. I have not checked how the two relate.</li>
</ul>
<h2>What I would do with this</h2>
<p>This is my opinion, not the standard's.</p>
<ul>
<li>Classify every agent flow by its principal first: a user, a workload, or a transaction. The drafts are splitting along exactly that line, so your design will map onto them more easily.</li>
<li>Do not forward the inbound token to the next hop. Exchange it for one whose audience is the next API. I covered this in <a href="https://iamops.dev/mcp-server-no-token-passthrough/">MCP server, no token passthrough</a> and <a href="https://iamops.dev/entra-on-behalf-of-agent-middle-tier/">Entra on-behalf-of for an agent middle tier</a>.</li>
<li>Treat the gateway case as unsettled until the interims on issue #114 report back.</li>
<li>Write the draft name and revision into the design document. Several of these changed name or number within weeks.</li>
</ul>
<h2>What I did not check</h2>
<p>I did not attend any session, and I did not watch the recordings in full. I linked the <a href="https://www.youtube.com/watch?v=V0tRi789ngE">OAuth session</a> and the <a href="https://www.youtube.com/watch?v=g-EubYQF1xk">WIMSE session 1</a> recordings. I did not find a recording of the joint session yet, so everything about it comes from the notes. I did not run or implement any of these drafts. The notes were written by volunteers and may contain mistakes. The Friday OAuth session, which includes several of the drafts above, has not taken place yet. I will update this post if something material changes.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Workload identity news: GitHub's immutable sub claim, Entra wildcard credentials and WorkOS agent auth</title>
      <link>https://iamops.dev/workload-identity-news-immutable-sub-entra-wildcards-workos/</link>
      <guid isPermaLink="true">https://iamops.dev/workload-identity-news-immutable-sub-entra-wildcards-workos/</guid>
      <pubDate>Fri, 20 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>News</category>
      <category>GitHub Actions</category>
      <category>OIDC</category>
      <category>Entra ID</category>
      <category>Workload identity</category>
      <category>WorkOS</category>
      <category>AI agents</category>
      <description>GitHub's default OIDC sub now carries owner and repo IDs, Entra wildcard credentials are still in preview, and WorkOS shipped agent auth. Sources and dates.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/workload-identity-news-immutable-sub-entra-wildcards-workos.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>Since 15 July 2026, GitHub Actions tokens for new repositories carry the owner ID and the repository ID in the sub claim. Older repositories keep the name-only format until you opt in, so a credential has to match the format the repository really emits.</li>
<li>Entra wildcard credentials are still in preview. Microsoft's docs say a GitHub expression must also match repository_id or repository_owner_id. In my lab Entra accepted a sub-only expression, and an owner-wide one issued a token to another repository of the same owner. I still add repository_id.</li>
<li>WorkOS shipped agent identity (Agent Auth, early access, 2 Sep), Claude auto-connect for MCP Auth (early access, 3 Nov) and RFC 8693 token exchange for Connect (10 Nov). I found no WorkOS item about federating workloads from another issuer.</li>
<li>What I would do: trust the immutable sub, add repository_id to every wildcard, delete credentials for repositories that no longer exist, and prove it with real runs. My lab does that for GitHub Actions to Azure.</li>
</ul>
<p>I read the primary pages for these items on 20 November 2026: GitHub's changelog and docs, Microsoft Learn and the WorkOS changelog. Dates below are the ones those pages show. The first two items matter for my <a href="https://iamops.dev/github-actions-azure-workload-identity-federation/">GitHub Actions to Azure lab</a>, which is why I am putting them together.</p>
<h2>GitHub puts owner and repo IDs in the sub claim</h2>
<p>On 23 April 2026 GitHub announced <a href="https://github.blog/changelog/2026-04-23-immutable-subject-claims-for-github-actions-oidc-tokens/">immutable subject claims for Actions OIDC tokens</a>. The post was edited on 10 June 2026: the delimiter between a name and its ID is now <code>@</code>, not <code>-</code>. If you copied an example from the April text, check it.</p>
<p>The rules, from the <a href="https://docs.github.com/en/actions/reference/security/oidc">OIDC reference</a>:</p>
<ul>
<li>Repositories created after 15 July 2026 get the new default <code>sub</code>. Renames and transfers after that date also move to it.</li>
<li>Older repositories keep the name-only format until you opt in. You can do that per organization or per repository, in the OIDC settings or with the REST API (<code>use_immutable_subject</code>).</li>
<li>GitHub Enterprise Server is not included.</li>
<li>A custom claim template cannot drop the IDs. With <code>include_claim_keys</code>, <code>owner_id</code> and <code>repo_id</code> stay in the <code>repo</code> segment.</li>
</ul>
<table>
<thead>
<tr>
<th>Format</th>
<th><code>sub</code> for a push to main</th>
</tr>
</thead>
<tbody>
<tr>
<td>Name only</td>
<td><code>repo:octo-org/octo-repo:ref:refs/heads/main</code></td>
</tr>
<tr>
<td>Immutable</td>
<td><code>repo:octo-org@123456/octo-repo@456789:ref:refs/heads/main</code></td>
</tr>
</tbody>
</table>
<p>The example values come from GitHub's docs. The reason is in the changelog: if a repository or organization name is recycled, a new owner can mint tokens with the same subject and reach cloud resources that still trust the original one. The IDs are never reused, so the old trust does not transfer.</p>
<p>In my lab I created a fresh private repository and its <code>sub</code> came out in the new format. That changes the setup order. I create the repository first, read the two IDs from the API, and only then create the federated credential. GitHub's docs show the immutable format for Azure, AWS, Google Cloud and HashiCorp Vault trust policies. I only tested Azure.</p>
<h2>What Entra can match now</h2>
<p>Microsoft still labels <a href="https://learn.microsoft.com/en-us/entra/workload-id/workload-identities-flexible-federated-identity-credentials">flexible federated identity credentials</a> as preview. The page is dated 18 September 2026. Instead of one exact <code>subject</code>, the credential carries a <code>claimsMatchingExpression</code> with <code>languageVersion</code> set to 1, and <code>subject</code> must be null. The concept page says the Azure CLI has no explicit support yet and shows <code>az rest</code> against Graph beta, which is what I used for an app registration. The CLI reference for <code>az identity federated-credential</code> (user-assigned managed identities) does list <code>--claims-matching-expression-*</code> parameters, marked Preview.</p>
<table>
<thead>
<tr>
<th>Operator</th>
<th>What it does</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>eq</code></td>
<td>Exact match on one claim</td>
</tr>
<tr>
<td><code>matches</code></td>
<td>Wildcards: <code>*</code> for any run of characters, <code>?</code> for one character</td>
</tr>
<tr>
<td><code>and</code></td>
<td>Combines conditions on several claims</td>
</tr>
</tbody>
</table>
<p>For GitHub, Microsoft's <a href="https://learn.microsoft.com/en-us/entra/workload-id/workload-identities-set-up-flexible-federated-identity-credential">setup page</a> says the expression must match <code>sub</code> and one or both of <code>repository_id</code> and <code>repository_owner_id</code>. That holds whether <code>sub</code> is name-based, customized or immutable. <code>sub</code> and <code>job_workflow_ref</code> accept <code>eq</code> and <code>matches</code>. The two ID claims accept only <code>eq</code>. Microsoft's <a href="https://learn.microsoft.com/en-us/entra/workload-id/workload-identities-github-immutable-subjects">migration guide</a> uses this example:</p>
<pre><code class="language-text">claims['sub'] matches 'repo:octo-org@123456/octo-repo@456789:*' and claims['repository_id'] eq '456789'
</code></pre>
<p>Microsoft also published a <a href="https://learn.microsoft.com/en-us/entra/workload-id/workload-identities-github-immutable-subjects">migration guide</a>, dated 28 July 2026. The order is: create a credential for the immutable subject next to the old one, enable immutable subjects in GitHub, validate a run, then delete the old credential. A companion page on <a href="https://learn.microsoft.com/en-us/entra/workload-id/workload-identities-federated-credential-mutable-subjects">mutable subjects</a> describes subject recycling and asks you to delete dangling credentials, the ones whose workload no longer exists.</p>
<p>Here my own run differs from the docs. In the <a href="https://iamops.dev/github-actions-azure-workload-identity-federation/">lab</a> I created two expressions that matched only <code>sub</code> (<code>feature-*</code> and <code>v*</code>), with no <code>repository_id</code>. Entra accepted both and the matching runs passed. Those patterns contained the owner and repository IDs, so they were pinned anyway. In a later check the same day, Entra also accepted an owner-wide expression with no <code>repository_id</code> or <code>repository_owner_id</code> clause, and that credential issued a token to a different repository of the same owner. I still recommend adding <code>repository_id</code>. Microsoft documents it as required and the feature is in preview, so a sub-only credential may be refused or stop matching later. And the ID check does not depend on writing the pattern right: an owner-wide wildcard already issued a token to another of my repositories, and a name-only <code>sub</code> of an older repository can match a name you no longer own.</p>
<h2>How one token meets two credentials</h2>
<figure class="b-fig"><img src="https://iamops.dev/img/workload-identity-news-immutable-sub-entra-wildcards-workos.svg" alt="A matrix of two Entra federated credentials against four GitHub Actions runs. The exact credential for main accepts only a push to main. The wildcard credential for release/* with a repository_id check accepts only a push to release/1. A feature branch and a pull request match neither." width="1200" height="630" loading="lazy" decoding="async"><figcaption><strong>Which sub values each credential accepts.</strong> This is my own summary, drawn from the pattern of each credential. The IDs are the example values from GitHub's docs.</figcaption></figure>
<p>The point of the picture: the part of <code>sub</code> after the IDs is the run. A push to main, a push to a release branch, a feature branch and a pull request each send a different value, and Entra compares it with the credential. The IDs in the middle are what stop another repository with the same name from matching. My lab runs each of these and prints the exact <code>sub</code> for every case.</p>
<h2>WorkOS: what I found</h2>
<p>I checked the <a href="https://workos.com/changelog">WorkOS changelog</a> because it keeps shipping auth for agents and MCP. These are the items from August to 20 November that touch agent or workload credentials:</p>
<table>
<thead>
<tr>
<th>Date</th>
<th>Item</th>
<th>What WorkOS says</th>
</tr>
</thead>
<tbody>
<tr>
<td>2 Sep 2026</td>
<td><a href="https://workos.com/changelog/agent-auth">Agent Auth</a></td>
<td>Early access. Agents get identities in AuthKit and short-lived, tightly scoped tokens on every run, delegated for a user or autonomous within an organization. Sessions can be revoked instantly.</td>
</tr>
<tr>
<td>4 Sep 2026</td>
<td><a href="https://workos.com/changelog/mcp-enterprise-managed-authorization-ema">MCP Enterprise-Managed Authorization (EMA)</a></td>
<td>MCP Auth supports EMA, so an MCP client can reach downstream MCP servers through the company's identity provider without a consent screen per app. Access on request.</td>
</tr>
<tr>
<td>3 Nov 2026</td>
<td><a href="https://workos.com/changelog/workos-mcp-auth-supports-claude-auto-connect">Claude auto-connect</a></td>
<td>Early access. For organizations whose identity provider does not support Cross App Access, Claude issues the identity assertion (ID-JAG) and MCP Auth exchanges it for an access token to your MCP server.</td>
</tr>
<tr>
<td>10 Nov 2026</td>
<td><a href="https://workos.com/changelog/token-exchange-for-workos-connect">Token exchange for WorkOS Connect</a></td>
<td>RFC 8693. A first-party Connect app can exchange a token for another registered resource, carry key claims forward and narrow the scopes.</td>
</tr>
</tbody>
</table>
<p>The last two connect to things I already wrote. Claude auto-connect is the ID-JAG flow from <a href="https://iamops.dev/id-jag-explained/">ID-JAG explained</a>, with Claude as the issuer. The token exchange is the pattern my <a href="https://iamops.dev/mcp-server-no-token-passthrough/">MCP no-passthrough lab</a> builds by hand.</p>
<p>None of this is workload identity federation in the Entra sense, where you trust tokens from another issuer. I found no WorkOS changelog item about that, and none about machine-to-machine auth. What the items share with the GitHub story is the idea of a short-lived, narrow credential for each run instead of a stored key. Two other agent items, Agent Registration (4 August) and Agent Vault (17 November), are about letting agents sign in to AuthKit with the auth.md protocol and giving them signed-in browser sessions, so I left them out. I did not try any WorkOS product.</p>
<h2>What I would do</h2>
<p>This is my opinion, not Microsoft's or GitHub's guidance.</p>
<ul>
<li>For a new repository, check any credential you wrote from older examples. The subject now has IDs in it, and a name-only subject will not match.</li>
<li>For an old repository, follow Microsoft's order: add the immutable credential, opt in, run a workflow, then delete the old credential.</li>
<li>Put <code>repository_id</code> in every expression, even when the pattern contains the IDs. Entra accepted sub-only expressions in my lab, and an owner-wide one issued a token to another repository of the same owner. The docs still require the ID check, and I still add it.</li>
<li>List the federated credentials on your app registrations and delete the ones whose repository is gone.</li>
</ul>
<p>The <a href="https://iamops.dev/github-actions-azure-workload-identity-federation/">lab</a> shows the failure that follows from exact matching. With only a credential for main, one of six kinds of run passed. It also shows a trap: a credential for <code>pull_request</code> also trusts <code>pull_request_target</code> runs, and those get secrets.</p>
<h2>What I did not check</h2>
<ul>
<li>I did not opt an existing repository in, and I did not call GitHub's preview endpoint that shows the new subject prefix.</li>
<li>I tested only Azure. AWS, Google Cloud and Vault are in GitHub's docs, and I did not run them.</li>
<li>I did not test GitHub Enterprise Server, which GitHub excludes.</li>
<li>I read the WorkOS changelog entries and did not try any product or read the linked docs. Two of the items are early access.</li>
<li>Microsoft's flexible credential pages still say preview. I did not find a general availability date, and I am not guessing one.</li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>ID-JAG explained: how AI agents get cross-app access under enterprise control</title>
      <link>https://iamops.dev/id-jag-explained/</link>
      <guid isPermaLink="true">https://iamops.dev/id-jag-explained/</guid>
      <pubDate>Thu, 19 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>Labs</category>
      <category>ID-JAG</category>
      <category>Cross App Access</category>
      <category>AI agents</category>
      <category>OAuth</category>
      <category>Standards</category>
      <description>How ID-JAG and Cross App Access let a company's identity provider approve AI agent access to other apps, with lab screenshots and the draft's current status.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/id-jag-explained.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>ID-JAG is a proposed IETF standard (draft -06) that lets a company's identity provider approve an AI agent's access to another app.</li>
<li>The identity provider issues a short-lived signed assertion; the other app verifies it and issues its own short-lived access token.</li>
<li>It replaces per-app consent pop-ups and long-lived keys with one place for policy and audit.</li>
<li>It is still a draft: key binding and just-in-time provisioning may move to separate documents, and several products already implement it.</li>
<li>The lab run on the public xaa.dev sample shows the flow, with redacted screenshots and a recording.</li>
</ul>
<p>Many AI agents need to reach several business applications on a user's behalf. Today each connection usually triggers its own consent prompt, or relies on a long-lived key stored in the agent's settings. Neither is easy for an organisation to see or control.</p>
<p><strong>ID-JAG</strong> is a proposed standard that moves that approval from the individual user to the organisation's identity provider. This article explains how it works, where the specification stands and what a lab run of a public sample application shows.</p>
<h2>The problem</h2>
<p>Employees sign in once, with one account, through <em>single sign-on</em>. The system behind it is the company's <em>identity provider</em>, called the company sign-in below.</p>
<p>An AI agent then needs to read tasks in one application, files in another and a calendar in a third. Each of those applications runs its own authorisation server, which knows nothing about the agent. In practice each connection works in one of two ways:</p>
<ul>
<li><strong>A consent prompt</strong> for each application and each user. Users tend to approve without reading, and the organisation has no central record.</li>
<li><strong>A long-lived key</strong> pasted into the agent's configuration. It does not expire, and anyone who obtains it can use it.</li>
</ul>
<p>The alternative is a single place that vouches for the user and the agent, applies the organisation's rules and keeps a record.</p>
<h2>What an ID-JAG does</h2>
<p>The full name is <em>Identity Assertion JWT Authorization Grant</em>. In practice it is a <strong>short-lived, signed assertion</strong> issued by the company sign-in. It states that this user's organisation allows this agent to request specific access from that application.</p>
<p>The pattern built around it is informally called <strong>Cross App Access (XAA)</strong>. The oauth.net page on it says that it &quot;replaces the user's manual approval step with a <a href="https://iamops.dev/keycloak-token-exchange-rfc-8693/">token exchange</a>&quot;.</p>
<p><img src="https://iamops.dev/img/id-jag-flow.svg" alt="The five steps of an ID-JAG flow, from signing in once to the agent using a short-lived access token."></p>
<p>The flow in five steps:</p>
<ol>
<li>The user signs in at work once, in the usual way.</li>
<li>The agent asks the company sign-in for an assertion that covers one particular application.</li>
<li>The company sign-in evaluates its policy. If the connection is allowed, it issues the ID-JAG.</li>
<li>The agent presents the ID-JAG to the other application's authorisation server. That server verifies the signature, applies <strong>its own</strong> rules and issues a short-lived access token.</li>
<li>The agent uses that token to call the application.</li>
</ol>
<p>Two details matter. The receiving application still decides what to grant, so the ID-JAG is not a blank cheque. And because the company sign-in sits in the middle, there is one place to define policy and one place to audit what happened.</p>
<p>Technically this chains two existing standards: token exchange (RFC 8693) and the JWT bearer grant (RFC 7523).</p>
<h2>Lab: the flow in the xaa.dev sample</h2>
<p>The free <strong>xaa.dev</strong> playground from Okta's developer team makes the flow visible. In a lab run on 7 November 2026, its sample application was run locally in a test setup. The app has a &quot;Behind the scenes&quot; panel that marks each stage as it completes: company sign-in, the ID-JAG, the access token and the checklist fetched from the second application. No consent prompt appeared at any point.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/xaa/dashboard.webp" alt="The xaa.dev sample app with the onboarding checklist on the left and the Behind the scenes panel on the right, showing all four stages completed." width="1280" height="975" loading="lazy" decoding="async"><figcaption><strong>Overview.</strong> The checklist (left) was fetched from the second application using the enterprise identity. The panel (right) lists the four stages: company sign-in, ID-JAG, access token, checklist over MCP. The subject claim is redacted.</figcaption></figure>
<p><strong>Stage 2: the assertion.</strong> After the company sign-in, the sample exchanges the user's ID token for an ID-JAG (RFC 8693). Expanding stage 2 shows the decoded assertion: the issuer, the audience (the other application's authorisation server), the requested resource and scope, and the issue and expiry times, which here are five minutes apart. Identifiers that point to a person or a client are redacted.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/xaa/id-jag.webp" alt="Stage 2 expanded in the Behind the scenes panel: the decoded ID-JAG with issuer, audience, resource, issue and expiry times and scope visible, identifiers redacted with black boxes." width="1280" height="975" loading="lazy" decoding="async"><figcaption><strong>Stage 2, the ID-JAG.</strong> Issuer, audience, resource, validity period and scope are visible. Subject, client and token identifiers are covered by black boxes, and the encoded token is not shown.</figcaption></figure>
<p><strong>Stages 3 and 4: the access token.</strong> The other application's authorisation server verifies the ID-JAG (RFC 7523) and returns an access token with a limited scope. The sample then uses it to fetch the checklist over MCP. The token claims show who issued the token, for which audience and with which scope.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/xaa/access-token.webp" alt="The access token section expanded, with the token claims showing issuer, audience and the todos.read and mcp.access scopes; the encoded token and the subject are redacted." width="1280" height="975" loading="lazy" decoding="async"><figcaption><strong>Stages 3 and 4, the access token.</strong> The token claims (issuer, audience, scope) are real. The encoded token and the subject are redacted.</figcaption></figure>
<p>I recorded the whole flow against the public xaa.dev playground, using the sample app in a local test setup with a synthetic user. It starts at the sign-in page, so you see each hop happen and then its decoded header and payload. The only thing added is the caption bar across the top. It is silent and about one minute 44 seconds long.</p>
<figure class="b-fig"><video controls preload="none" playsinline muted poster="https://iamops.dev/media/xaa/idjag-flow-poster.webp" width="1280" height="800" aria-describedby="vid-cap"><source src="https://iamops.dev/media/xaa/idjag-flow.mp4" type="video/mp4"><track kind="captions" src="https://iamops.dev/media/xaa/idjag-flow.en.vtt" srclang="en" label="English" default></video><figcaption id="vid-cap"><strong>Screen recording</strong> (1 min 44 s, no sound, captions available): sign-in at the company IdP, then each hop with its decoded header and payload. Synthetic user and short-lived demo tokens from the public playground. The encoded token strings are shortened for layout.</figcaption></figure>
<h3>What you're seeing</h3>
<ol>
<li><strong>0:08 Sign-in at the company IdP.</strong> The user signs in at idp.xaa.dev, not in the agent app. The app never sees a password, and the IdP is where MFA and sign-in rules live. The playground takes any six digits as the second factor.</li>
<li><strong>0:30 The agent app gets an ID token.</strong> It proves who signed in. Look at <code>iss</code> (the IdP), <code>aud</code> (the app's client ID) and <code>exp</code>, one hour after <code>iat</code>. The app now has an identity from the organisation, but no access to the todo app yet.</li>
<li><strong>0:47 The IdP exchanges it for an ID-JAG (RFC 8693).</strong> The agent asks for an assertion aimed at one target. The header type is <code>oauth-id-jag+jwt</code>. The claims name the todo app's authorisation server in <code>aud</code>, plus <code>resource</code>, <code>client_id</code> and <code>scope</code>. In a real deployment this is where the administrator's policy decides. The playground just allows it.</li>
<li><strong>0:58 The ID-JAG is short lived.</strong> <code>exp</code> is 300 seconds after <code>iat</code>. A leaked ID-JAG is useless after five minutes, and it only works at the one server named in <code>aud</code>.</li>
<li><strong>1:07 The todo app's own authorisation server issues the access token (RFC 7523).</strong> The agent presents the ID-JAG there. That server checks the IdP's signature, then applies its own rules. The token has that server as <code>iss</code>, the MCP server as <code>aud</code> and only the approved <code>scope</code>. The user is identified inside the todo app's own namespace.</li>
<li><strong>1:30 The agent calls the API.</strong> With the access token it reads the checklist over MCP. The left side of the page is that response. No consent screen appeared at any point.</li>
</ol>
<p><em>The lab uses a public sample with throwaway accounts and sample data. The screenshots were cropped to the application and redacted before publication. The recording shows the decoded demo tokens in full, because they come from the public playground, belong to a synthetic user and expire within an hour. The encoded token strings are shortened for layout.</em></p>
<h2>Where the specification stands</h2>
<p><strong>It is still a draft, not a finished standard.</strong> The document is <em>draft-ietf-oauth-identity-assertion-authz-grant</em>, now at version <strong>-06</strong>, dated 31 October 2026. It is a working-group document of the IETF OAuth group, written by authors from Okta and Ping Identity and one independent author. The intended outcome is a Standards Track document, but drafts can still change.</p>
<p><strong>IETF 127, 18 November 2026.</strong> The authors presented the draft at the OAuth session. The slides name three open themes:</p>
<ul>
<li><strong>Just-in-time provisioning</strong>, meaning how an application handles a user it has never seen, because its first contact is an ID-JAG. The slides recommend handling this in a future extension.</li>
<li><strong>Key binding</strong>, meaning tying tokens to a cryptographic key so that a stolen token is useless. The slides ask whether to move it into its own extension, and the notes record a recommendation for several follow-up drafts. One participant said that moving topics into other documents leaves the draft feeling unfinished. The author's reply was that provisioning is optional and that key binding applies more widely than this draft.</li>
<li><strong>Gateways and proxies</strong>, which are common in AI deployments where a gateway sits between the agent and the applications. This is an open issue. A separate draft is proposed, and the notes say the authors would like extra (&quot;interim&quot;) meetings on gateways and on key binding.</li>
</ul>
<p>The notes record these as <strong>recommendations</strong>. No final decision appears in them. The next steps on the slides are to triage the remaining issues, either fixing each in a version -07 or setting it aside deliberately, and then to request a working-group last call.</p>
<h2>Implementations</h2>
<p>Several vendors already implement it, even though the draft is not final. According to the <a href="https://oauth.net/cross-app-access/">oauth.net implementations list</a>, checked on 19 November 2026:</p>
<ul>
<li><strong>Identity providers that issue ID-JAGs</strong> include Okta, Oracle OCI IAM, Ping, Gravitee, Descope, Keycloak (marked &quot;in progress&quot;) and several others.</li>
<li><strong>Authorisation servers that accept them</strong> include Okta, Oracle OCI IAM, Ping, Gravitee, Auth0 (early access), Stytch and WorkOS AuthKit (early access).</li>
<li><strong>AI applications and tools acting as clients</strong> include Claude, OpenAI Codex CLI and Visual Studio Code (preview).</li>
<li><strong>Applications on the receiving end</strong> include Asana, Atlassian, Linear, Notion and Slack, some of them in beta.</li>
</ul>
<p>A few dated examples:</p>
<ul>
<li><strong>Oracle</strong>: on 9 October 2026 Oracle released ID-JAG token exchange in OCI IAM.</li>
<li><strong>Gravitee</strong>: Access Management 4.13, announced on 12 November 2026, can play both roles, issuing ID-JAGs and accepting them.</li>
<li><strong>Okta</strong>: on 13 November 2026 it announced general availability of support for third-party identity providers, and names Ping, Descope and Oracle as XAA-enabled providers whose users and agents it can work with.</li>
<li><strong>MCP</strong>: the Model Context Protocol, a common way for AI tools to connect to applications, has an &quot;Enterprise-Managed Authorization&quot; extension that uses an ID-JAG. Its project blog announced it as stable in June 2026.</li>
</ul>
<p>Microsoft Entra was not on the oauth.net list at the time of checking.</p>
<h2>How it differs from consent screens and on-behalf-of</h2>
<table>
<thead>
<tr>
<th></th>
<th>Consent prompt</th>
<th>On-behalf-of (OBO)</th>
<th>ID-JAG / XAA</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Who approves</strong></td>
<td>The user, application by application</td>
<td>The user's earlier consent, passed along</td>
<td>The company sign-in, following rules set by an administrator</td>
</tr>
<tr>
<td><strong>What the user sees</strong></td>
<td>A prompt for each application</td>
<td>Usually nothing after the first sign-in</td>
<td>Nothing</td>
</tr>
<tr>
<td><strong>Where it works</strong></td>
<td>Anywhere OAuth works</td>
<td>One service calling another, inside one identity system</td>
<td>Between applications and organisations that each run their own authorisation server</td>
</tr>
<tr>
<td><strong>Central control</strong></td>
<td>Limited</td>
<td>Some</td>
<td>The purpose of the design</td>
</tr>
</tbody>
</table>
<p><strong>Versus consent screens:</strong> a consent prompt asks the user every time. An ID-JAG applies the organisation's rules once and then enforces them silently.</p>
<p><strong>Versus <a href="https://iamops.dev/entra-on-behalf-of-agent-middle-tier/">on-behalf-of</a>:</strong> Microsoft's documentation describes OBO as a web API using a user's identity to call another API, which passes the user's identity and permissions along the chain. It happens within the Microsoft identity platform. ID-JAG addresses a related problem across boundaries: the two applications have different authorisation servers, and a third party, the company sign-in, vouches for the user. The two feel similar from the user's seat, but the trust is arranged differently.</p>
<h2>A consideration</h2>
<p>Fewer prompts means more convenience, but also fewer moments where a person reviews the request. This is an assessment, not a claim from the standard: the design only helps if the organisation's policies are sound and reviewed regularly. ID-JAG makes it <strong>possible</strong> to see and control agent access in one place. Someone still has to do the controlling.</p>
<p>This article will be updated as the draft moves towards working-group last call.</p>
]]></content:encoded>
    </item>
    <item>
      <title>US banks put customers on the hook for third-party AI agents</title>
      <link>https://iamops.dev/banks-ai-agents-customer-liability/</link>
      <guid isPermaLink="true">https://iamops.dev/banks-ai-agents-customer-liability/</guid>
      <pubDate>Wed, 18 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>News</category>
      <category>AI agents</category>
      <category>Banking</category>
      <category>Security</category>
      <category>Liability</category>
      <description>On 18 November 2026 TechCrunch reported that Citi, PNC and other US banks now treat a third-party AI agent's actions as the customer's. What the new terms say.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/banks-ai-agents-customer-liability.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>On 18 November 2026, TechCrunch reported that Citi updated its Online User Agreement this week: customers who grant a third-party AI agent access are responsible for what that agent does, including if the tool leaks credentials or is hacked.</li>
<li>The same report says JPMorgan and Bank of America announced similar policies in October 2026, PNC changed its terms on 18 November, and Citizens emailed customers in the same week.</li>
<li>Wells Fargo's own notice says an updated Online Access Agreement takes effect on 24 November 2026: a third-party AI tool is not operated by the bank, and requests may be treated as if they came from you.</li>
<li>According to TechCrunch, AI agents that Citi itself provides can be used without that extra liability. Until a bank can tell a person from an agent, a shared login is treated as you.</li>
</ul>
<p>On 18 November 2026, TechCrunch reported that several large US banks have updated their terms for customers who give a third-party AI agent access to an account. The change is not a ban. It is a statement about who is responsible when something goes wrong.</p>
<h2>What the banks said</h2>
<p>Citibank updated its Online User Agreement in the week of 18 November 2026. A Citi spokesperson told TechCrunch that customers who grant account access to third-party AI agents are responsible for activities conducted through those agents. TechCrunch also reported that Citi's update goes further: if the AI tool leaks the credentials, or is hacked, the customer is responsible for what attackers then do with the account.</p>
<p>The same article says JPMorgan and Bank of America announced similar policies in October 2026, that PNC changed its terms on 18 November, and that Citizens emailed its customers in the same week.</p>
<p>Wells Fargo has posted its own customer notice: an updated Online Access Agreement takes effect on 24 November 2026. The bank says that if you use a third-party AI tool or agent to access your accounts, the tool is not operated by Wells Fargo, that requests submitted through the tool may be treated as if they came directly from you, and that it reserves the right to restrict or block access from certain third-party AI tools.</p>
<p>I am not a lawyer, and this is not legal advice. Some of these terms, including Wells Fargo's, still leave room for protections that the law already gives you. The direction is still clear.</p>
<h2>Why this is happening now</h2>
<p>An AI agent that signs in with the customer's username and password looks, to the bank, like the customer. The audit trail, the record of who did what, does not show a separate actor. That is why a bank can say the agent's payment, or a hacker's payment after a leaked login, was authorised by you.</p>
<p>TechCrunch notes a useful contrast inside Citi's own terms: AI agents that Citi itself provides can be used without that extra liability. The bank is drawing a line between tools it controls and tools it does not.</p>
<p>Anthropic's personal finance tool, mentioned in the same article, is described as read-only: it &quot;can't move, manage, or invest your money.&quot; That shrinks the risk of a payment going out, though it does not solve the case where a tool that only reads an account still holds a login.</p>
<figure class="b-fig"><img src="https://iamops.dev/img/banks-ai-agents-customer-liability.svg" alt="Four steps in a row: a customer shares a login with an AI agent, the agent acts or is hacked, the bank only sees the customer's credentials, and the bank treats the action as the customer's. A shared login leaves no separate trail." width="1200" height="630" loading="lazy" decoding="async"><figcaption><strong>What the bank can see.</strong> Once the customer shares a login, the bank has no separate trail for the agent. A payment, or a login used after a leak, can look like the customer acting alone.</figcaption></figure>
<h2>What I would do</h2>
<p>Do not hand a bank login to a third-party AI tool unless you have a clear reason and you understand the terms. If a tool already has that access, revoke it at the provider, change the password if the tool had it, and keep a record.</p>
<p>The better long-term pattern is a named agent with a narrow, time-limited permission that you can turn off without changing your own password. Banks and vendors are starting to talk about that, but the terms reported on 18 November still assume a shared login. Until the bank can tell a person from an agent, the agent is you.</p>
<p>If you want the technical side of how an agent can get a token without sharing a password, I wrote about <a href="https://iamops.dev/id-jag-explained/">ID-JAG</a>. On 17 November Microsoft also published a lab analysis of <a href="https://iamops.dev/device-code-phishing-ai-agents/">device code phishing against AI coding assistants</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Device code phishing and AI agents: risks and mitigations</title>
      <link>https://iamops.dev/device-code-phishing-ai-agents/</link>
      <guid isPermaLink="true">https://iamops.dev/device-code-phishing-ai-agents/</guid>
      <pubDate>Tue, 17 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>News</category>
      <category>Phishing</category>
      <category>Device code</category>
      <category>AI agents</category>
      <category>Security</category>
      <description>Microsoft researchers showed in a controlled lab that one approved device code could hand an attacker an AI coding assistant session. Risks and mitigations.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/device-code-phishing-ai-agents.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>Device code phishing tricks a person into approving a sign-in that an attacker started.</li>
<li>In a controlled lab test, Microsoft showed that one approved code could let an attacker steer a GitHub Copilot CLI session and reach cloud session history and private repositories, depending on settings.</li>
<li>Those results are proof of concept; Microsoft says it has not seen these outcomes in real attacks, though device code phishing itself is a recurring route to account takeover.</li>
<li>Enter a device code only if you started the request yourself.</li>
<li>Review the apps connected to your accounts and use the most restrictive remote-control and session-storage settings your AI tools allow.</li>
</ul>
<p>Device code sign-in is the flow in which a device without a convenient keyboard shows a short code and the user enters it on a second device to authenticate. Smart TVs use it, and so do many command-line tools used by developers.</p>
<p>On 17 November 2026, Microsoft's security researchers published an analysis of how the same flow can be used against AI coding assistants.</p>
<h2>The attack pattern</h2>
<p>In <em>device code phishing</em>, the <strong>attacker</strong> starts the sign-in on their own machine, receives a code and sends it to the target. The message may look like an IT request or a licence check. The target opens the genuine sign-in page, enters the code and approves, which signs the attacker in.</p>
<p>The sign-in page is legitimate, which is why the technique works. In Microsoft's words, the legitimate site alone does not tell the user who started the request.</p>
<figure class="b-fig"><img src="https://iamops.dev/img/device-code-phishing-ai-agents.svg" alt="Sequence diagram with three parties: the attacker, the person and the genuine sign-in page. The attacker asks for a device code and sends the user code to the person. The person enters it on the real page and approves, and the attacker's polling then receives tokens for the person's account." width="1200" height="630" loading="lazy" decoding="async"><figcaption><strong>The flow from the attacker's side.</strong> Steps 1 and 4 run on the attacker's machine. The person only does step 3, on a page that really belongs to the sign-in service, so the code is the one thing worth checking.</figcaption></figure>
<h2>What Microsoft demonstrated</h2>
<p>The team ran a <strong>controlled lab test</strong> with GitHub Copilot's command-line tool as the example. With one approved code, they could, depending on the account's settings:</p>
<ul>
<li>steer an active session of the assistant remotely and have it run commands on the person's machine,</li>
<li>add misleading entries to the assistant's memory,</li>
<li>read session history stored in the cloud,</li>
<li>reach private code repositories visible to the account.</li>
</ul>
<p>Microsoft states that these are proof-of-concept results and that it has not observed these four outcomes in real attacks. Device code phishing itself is a different matter. Microsoft says it has been a recurring route to account takeover and names earlier campaigns, including one called EvilTokens that it helped disrupt in September 2026.</p>
<h2>Recommended mitigations</h2>
<ul>
<li><strong>Enter a device code only if you requested it yourself</strong>, on a screen you started. A code that arrives in a message from someone else is a warning sign, even when the page is genuine.</li>
<li><strong>Review the applications connected to your accounts</strong> and remove ones you do not recognise. Microsoft's guidance points to GitHub's &quot;authorized OAuth apps&quot; settings as an example.</li>
<li><strong>Use the most restrictive settings</strong> your AI tools allow for remote control and cloud storage of sessions.</li>
</ul>
<p>Microsoft's broader point is that the more an AI assistant can reach, the more a single phished approval is worth.</p>
<p><em>Source: <a href="https://www.microsoft.com/en-us/security/blog/2026/11/17/the-risks-of-device-code-authentication-for-ai-coding-agents/">Microsoft Security Blog, 17 November 2026</a>.</em></p>
]]></content:encoded>
    </item>
    <item>
      <title>Device code phishing: a briefing for managers after Microsoft's lab test</title>
      <link>https://iamops.dev/device-code-phishing-briefing-for-managers/</link>
      <guid isPermaLink="true">https://iamops.dev/device-code-phishing-briefing-for-managers/</guid>
      <pubDate>Tue, 17 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>News</category>
      <category>Phishing</category>
      <category>Device code</category>
      <category>AI agents</category>
      <category>Security</category>
      <description>On 17 November 2026 Microsoft showed in a lab that one approved device code can hand an attacker an AI coding assistant. What it is, and what to tell staff.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/device-code-phishing-briefing-for-managers.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>On 17 November 2026, Microsoft published a lab analysis of device code phishing against AI coding assistants. The page the person sees is genuine; the request is the attacker's.</li>
<li>In the lab, one approved GitHub device-code request let researchers steer a session, write misleading memory, read cloud session history, or reach private repositories, depending on settings.</li>
<li>Microsoft says those four outcomes are a proof of concept and have not been seen in the wild. Device code phishing itself is a recurring route to account takeover.</li>
<li>Enter a device code only for a sign-in you started yourself. Review connected applications and tighten what the assistant can reach.</li>
</ul>
<p>Device code sign-in is the flow where a device without a convenient keyboard shows a short code, and you enter that code on another device to approve the sign-in. Smart TVs use it. So do many command-line tools.</p>
<p>On 17 November 2026, Microsoft's security researchers published an analysis of how the same flow can be turned against AI coding assistants. I already wrote a <a href="https://iamops.dev/device-code-phishing-ai-agents/">longer post</a> on the technical detail. This is the shorter briefing I would give a manager.</p>
<h2>What the attack actually is</h2>
<p>In device code phishing, the attacker starts the sign-in on their own machine and receives a short code. They send that code to someone else, often dressed up as an IT request or a licence check. The person opens the genuine sign-in page, enters the code and approves. That signs the attacker in.</p>
<p>The page is real. That is why the trick works. Microsoft's point is that a legitimate site does not tell you who started the request. GitHub's own verification page, Microsoft notes, warns people never to use a code sent by someone else.</p>
<figure class="b-fig"><img src="https://iamops.dev/img/device-code-phishing-briefing-for-managers.svg" alt="Three steps in a row: someone sends you a short code, you enter it on a real sign-in page, and the person who started the request is signed in. Approve a code only if you started the sign-in yourself." width="1200" height="630" loading="lazy" decoding="async"><figcaption><strong>What the person actually does.</strong> The only step they take is entering a short code on a real sign-in page. The request behind that code was started by someone else.</figcaption></figure>
<h2>What Microsoft showed in the lab</h2>
<p>The team used GitHub Copilot's command-line tool as an example. The technique is not limited to that tool: any public client that supports this sign-in flow can be abused the same way, and the attacker chooses which permissions to request. A public client is an app that cannot keep a secret, such as a command-line tool or a television.</p>
<p>In a controlled lab test, a test account approved a GitHub device-code request that the researchers had started. With that one approval, they could, depending on the account's settings:</p>
<ul>
<li>steer an active session of the assistant remotely and have it run commands on the person's machine,</li>
<li>add misleading entries to the assistant's memory,</li>
<li>read session history stored in the cloud,</li>
<li>reach private code repositories visible to the account.</li>
</ul>
<p>Microsoft states that these are proof-of-concept results, and that it has not seen those four outcomes in real attacks. Device code phishing itself is older. Microsoft calls it a recurring route to account takeover, and names earlier campaigns, including one called EvilTokens that it helped disrupt in September 2026.</p>
<h2>What I would tell a team</h2>
<p>Enter a device code only for a sign-in you started yourself, on a screen you opened. A code that arrives in a message from someone else is a warning, even when the page is genuine.</p>
<p>Review the applications connected to work accounts and remove ones nobody recognises. Microsoft points to GitHub's settings for authorised OAuth apps as an example. OAuth apps are the applications a person has allowed to use an account.</p>
<p>For AI coding tools, use the tightest settings you can live with for remote control, cloud session storage and memory. An approval is only as valuable as what the assistant can reach.</p>
<p>Microsoft also describes detections in Microsoft Defender for phishing of this kind delivered by email or Teams, and a way to suspend a managed GitHub identity. Those are for security teams. The habit I would ask everyone to keep is the first one: if you did not start the sign-in, do not enter the code.</p>
<p>The <a href="https://iamops.dev/device-code-phishing-ai-agents/">longer post</a> has the step-by-step of the flow and the same source.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Microsoft Entra on-behalf-of flow for an agent middle tier: certificate credential, no client secrets</title>
      <link>https://iamops.dev/entra-on-behalf-of-agent-middle-tier/</link>
      <guid isPermaLink="true">https://iamops.dev/entra-on-behalf-of-agent-middle-tier/</guid>
      <pubDate>Sat, 14 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>Labs</category>
      <category>Entra ID</category>
      <category>On-behalf-of</category>
      <category>AI agents</category>
      <category>OAuth</category>
      <category>Workload identity</category>
      <description>Lab in a test tenant: device-code sign-in, an agent API exchanging the token on-behalf-of with a certificate and no secret, and an unconsented scope failing.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/entra-on-behalf-of-agent-middle-tier.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>For agents that call APIs on behalf of a signed-in user, Entra's current answer is the on-behalf-of (OBO) flow; ID-JAG is only a readiness survey there today.</li>
<li>The middle API proves itself with a certificate-signed assertion and holds zero client secrets.</li>
<li>One sign-in yields separate tokens per audience: the user stays the same and the calling application changes.</li>
<li>A scope nobody consented to fails with AADSTS65001; consent at the service principal is what counts.</li>
<li>OBO tokens do not keep the original client, so audits must join sign-in logs.</li>
</ul>
<p>On 14 November 2026 Microsoft added a Learn article that, for the first time, names <a href="https://iamops.dev/id-jag-explained/">ID-JAG</a> next to Microsoft Entra Agent ID and opens an interest form for it. It is a readiness survey, not a shipped feature: Entra neither issues nor accepts ID-JAGs today. For agents that need to call APIs for a signed-in user, Entra's current answer is the on-behalf-of (OBO) flow. I ran it end to end in a throwaway tenant and wrote down what each step does.</p>
<h2>What this lab shows</h2>
<p>Three app registrations stand in for an agent system:</p>
<table>
<thead>
<tr>
<th>App</th>
<th>Role</th>
<th>Credential</th>
</tr>
</thead>
<tbody>
<tr>
<td>Client</td>
<td>The agent's UI or command line. A public client, device-code sign-in.</td>
<td>None</td>
</tr>
<tr>
<td>Agent Middle API</td>
<td>The agent's back end. It performs the OBO exchange.</td>
<td>One X.509 certificate, <strong>zero client secrets</strong></td>
</tr>
<tr>
<td>Resource API</td>
<td>The downstream API. Exposes the delegated scope <code>Data.Read</code>.</td>
<td>n/a</td>
</tr>
</tbody>
</table>
<p>The user signs in once at the Client. The Client holds a token whose audience is the middle API only. The middle API exchanges it for a token for the Resource API and another for Microsoft Graph, proving who it is with a certificate-signed assertion instead of a secret.</p>
<h2>Setup</h2>
<p>Use a <strong>separate test tenant</strong> (Entra ID Free is enough, no Azure resources are needed). OBO tokens carry real user claims, and a throwaway tenant keeps experiments away from production consent, Conditional Access and audit logs. In the portal:</p>
<ol>
<li>Register the Resource API and expose a delegated scope <code>Data.Read</code> (admins and users).</li>
<li>Register the Agent Middle API, expose <code>access_as_user</code>, and add delegated permissions <code>Data.Read</code> and Microsoft Graph <code>User.Read</code>, then grant admin consent.</li>
<li>Generate a 2048-bit RSA key and a 60-day self-signed certificate with <code>openssl</code>, keep the private key on the machine (mode 0600), and upload only the public certificate under <em>Certificates &amp; secrets</em>.</li>
<li>Register the Client as a public client (redirect <code>http://localhost</code>, <em>Allow public client flows</em> on) with permission for <code>access_as_user</code> and <code>User.Read</code>.</li>
</ol>
<figure class="b-fig"><img src="https://iamops.dev/media/entra-on-behalf-of-agent-middle-tier/09-certificate.webp" alt="Terminal output of openssl showing the certificate subject and the SHA-1 fingerprint, which is replaced by a placeholder." width="1894" height="301" loading="lazy" decoding="async"><figcaption><strong>The credential.</strong> A self-signed certificate is the middle API's only credential. The thumbprint is replaced by a placeholder; the private key is never shown.</figcaption></figure>
<figure class="b-fig"><img src="https://iamops.dev/media/entra-on-behalf-of-agent-middle-tier/11-no-secrets.webp" alt="Microsoft Entra admin center, the Certificates and secrets page of the Agent Middle API with the Client secrets tab open, showing zero client secrets." width="1280" height="665" loading="lazy" decoding="async"><figcaption><strong>No secrets.</strong> The Client secrets tab shows 0. A certificate proves possession of a key that never travels; a secret is a reusable string that ends up in configuration and logs.</figcaption></figure>
<figure class="b-fig"><img src="https://iamops.dev/media/entra-on-behalf-of-agent-middle-tier/08-permissions.webp" alt="Microsoft Entra admin center, API permissions of the Agent Middle API: User.Read for Microsoft Graph and Data.Read for the Resource API, both delegated and granted for the directory." width="1280" height="665" loading="lazy" decoding="async"><figcaption><strong>What the middle tier may ask for.</strong> Entra checks these delegated grants at exchange time. Whatever is not listed and consented cannot be obtained downstream.</figcaption></figure>
<figure class="b-fig"><img src="https://iamops.dev/media/entra-on-behalf-of-agent-middle-tier/17-consent.webp" alt="Microsoft Entra admin center, Enterprise applications, Permissions of the Agent Middle API service principal, showing admin consent for User.Read and Data.Read." width="1280" height="665" loading="lazy" decoding="async"><figcaption><strong>What it actually got.</strong> App registrations show what an app asks for; the service principal's grants show what it was given. Governance tools should read the second.</figcaption></figure>
<h2>The run</h2>
<p><strong>Device-code sign-in.</strong> The Client asks the v2.0 <code>devicecode</code> endpoint for a code. The request carries only the Client's ID and the middle API's scope, no secret. The user enters the code on a second device and Entra shows an &quot;approve sign-in on another device&quot; check that names the app and the location; the user has to approve it by hand.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/entra-on-behalf-of-agent-middle-tier/18-devicecode.webp" alt="Terminal output of the device authorization request and its response, with tenant, client ID and user code replaced by placeholders." width="1894" height="530" loading="lazy" decoding="async"><figcaption><strong>Device authorization.</strong> Identifiers and the user code are placeholders.</figcaption></figure>
<p><strong>The user token.</strong> After approval the Client polls the token endpoint. Its token is useless against the Resource API or Graph directly, because its audience is the middle API.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/entra-on-behalf-of-agent-middle-tier/24-user-token.webp" alt="Decoded claims of the user token: audience is the middle API, appid is the Client, scope is access_as_user. Identifiers and the user's name are replaced by placeholders." width="1894" height="607" loading="lazy" decoding="async"><figcaption><strong>The only token the Client holds.</strong> Audience: the middle API. Application: the Client. Scope: access_as_user.</figcaption></figure>
<p><strong>The exchange.</strong> The middle API builds a client assertion (an RS256 JWT with the certificate's thumbprint in <code>x5t</code>; issuer and subject are its own client ID; audience is the token endpoint; ten minutes of life), signs it with the private key and posts the OBO request:</p>
<pre><code class="language-text">POST https://login.microsoftonline.com/&lt;tenant-id&gt;/oauth2/v2.0/token
  grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
  client_id=&lt;middle-api-id&gt;
  client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer
  client_assertion=&lt;RS256 JWT with x5t in the header&gt;
  assertion=&lt;the user token&gt;
  scope=api://&lt;resource-api-id&gt;/Data.Read
  requested_token_use=on_behalf_of
</code></pre>
<figure class="b-fig"><img src="https://iamops.dev/media/entra-on-behalf-of-agent-middle-tier/25-obo-resource.webp" alt="Decoded claims of the OBO token for the Resource API: audience is the Resource API, appid is the middle API, scope is Data.Read, same user object ID. Identifiers are placeholders." width="1894" height="607" loading="lazy" decoding="async"><figcaption><strong>Token for the Resource API.</strong> Audience: the Resource API. Application: the middle API. Scope: Data.Read. Same user.</figcaption></figure>
<p>The same assertion with scope <code>https://graph.microsoft.com/User.Read</code> returns a Graph token, which the lab uses once for <code>GET /v1.0/me</code>.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/entra-on-behalf-of-agent-middle-tier/26-obo-graph.webp" alt="Decoded claims of the OBO token for Microsoft Graph and the response of the Graph me call, with the user's name and principal name replaced by placeholders." width="1894" height="721" loading="lazy" decoding="async"><figcaption><strong>Token for Microsoft Graph, then a call to /me.</strong> One sign-in fans out to several audience-bound tokens. The user's name and principal name are placeholders.</figcaption></figure>
<p><strong>Compare the three tokens.</strong> The user never changes. The audience follows the API being called, and <code>appid</code> switches from the Client to the middle API.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/entra-on-behalf-of-agent-middle-tier/27-claims-compare.webp" alt="Side-by-side table of audience, appid, scope, object ID and tenant ID across the user token and the two OBO tokens. Identifiers are placeholders." width="1894" height="416" loading="lazy" decoding="async"><figcaption><strong>Three tokens side by side.</strong> Same user and tenant; the audience and the calling application change at each hop.</figcaption></figure>
<p><strong>The negative test.</strong> Asking for <code>https://graph.microsoft.com/Mail.Read</code>, which nobody consented to, fails at the token service:</p>
<figure class="b-fig"><img src="https://iamops.dev/media/entra-on-behalf-of-agent-middle-tier/28-negative.webp" alt="Terminal output of an invalid_grant error AADSTS65001: the user or administrator has not consented to use the application. Application ID, trace ID and correlation ID are placeholders." width="1894" height="416" loading="lazy" decoding="async"><figcaption><strong>AADSTS65001.</strong> Consent is checked at token time on the middle tier's service principal. There is no fallback to an interactive prompt for a non-interactive agent.</figcaption></figure>
<h2>Gotchas</h2>
<ul>
<li><strong>The original client is lost.</strong> Version 1 OBO tokens record only the last application (<code>appid</code>). There is no <code>act</code> claim as in an RFC 8693 implementation, so an audit has to join sign-in logs to rebuild the chain.</li>
<li><strong>The incoming audience must be the middle API.</strong> A token aimed at another app is rejected, which is the confused-deputy guard.</li>
<li><strong>Device code needs &quot;Allow public client flows&quot;.</strong> It is also the flow that device-code phishing abuses. The &quot;approve sign-in on another device&quot; screen is Microsoft's mitigation; train users to press &quot;This wasn't me&quot;, and restrict the flow with Conditional Access where agents do not need it.</li>
<li><strong>Admin consent at the service principal is what counts</strong>, not what the registration lists.</li>
</ul>
<h2>Security takeaways</h2>
<ol>
<li>Use a certificate or federated credential for the middle tier. No secret means nothing reusable to leak from configuration, CI variables or logs.</li>
<li>Keep the delegated scopes of the middle tier minimal and review them on the service principal.</li>
<li>Keep the Client credential-free. It can only ever hold the user's token for the middle API, never a downstream token.</li>
<li>Plan the audit join (user, agent, downstream audience) because OBO tokens do not keep the first hop.</li>
<li>Record which grant each hop uses (OBO today; ID-JAG once Entra supports it) and where consent lives, so access reviews can see service-principal grants.</li>
</ol>
<h2>What was not run</h2>
<p>Entra Agent ID blueprints and agent identities (the same lab with inheritable permissions) were not run. The Conditional Access policy that blocks <a href="https://iamops.dev/device-code-phishing-ai-agents/">device code</a> was not tested. The stretch tasks (removing consent and repeating the exchange, optional claims, v2 tokens) were not run. The portal screenshots were cropped to the page content; the browser bar, the profile menu and all tenant, application and user identifiers are removed. No recording is published for this lab.</p>
<p><em>Terminal images were rendered from the saved output of the run, with identifiers replaced by placeholders. Portal screenshots show the page content only.</em></p>
]]></content:encoded>
    </item>
    <item>
      <title>OAuth token exchange with Keycloak (RFC 8693): narrowing tokens for AI agents and MCP servers</title>
      <link>https://iamops.dev/keycloak-token-exchange-rfc-8693/</link>
      <guid isPermaLink="true">https://iamops.dev/keycloak-token-exchange-rfc-8693/</guid>
      <pubDate>Thu, 12 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>Labs</category>
      <category>Token Exchange</category>
      <category>Keycloak</category>
      <category>RFC 8693</category>
      <category>MCP</category>
      <category>AI agents</category>
      <description>A hands-on lab with Keycloak: an MCP server exchanges a user's token for a narrower one for a downstream API, then three bad exchanges are refused.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/keycloak-token-exchange-rfc-8693.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>RFC 8693 token exchange lets an MCP server swap a user's token for a narrower one aimed at a single downstream API.</li>
<li>In Keycloak it is enabled per client, and the downstream audience is an optional scope.</li>
<li>The exchanged token keeps the user as subject, has only the downstream audience, lives 300 seconds and carries no refresh token.</li>
<li>Three bad exchanges are refused: a client without the privilege, an audience with no scope, and a refresh token request.</li>
<li>There is no act claim in this setup, so the acting client shows up only as the authorized party.</li>
</ul>
<p>On 12 November 2026 Amazon Cognito added OAuth 2.0 Token Exchange (RFC 8693), a few days after WorkOS Connect did the same. Entra has had its own on-behalf-of flow for years. The pattern is now common to the major identity providers: a service that acts for a user swaps the user's token for a new token that is narrower, bound to one audience and short-lived, instead of forwarding the original. I ran it against a local Keycloak and wrote down what the server did.</p>
<p>This lab runs that pattern on a laptop with Keycloak, an open-source authorization server, so you can see exactly what changes inside the token and what the server refuses.</p>
<h2>What this lab shows</h2>
<p>An AI agent signs the user in and holds a token for an <a href="https://iamops.dev/mcp-server-no-token-passthrough/">MCP server</a>. The MCP server needs to call a payments API for that user. It must not forward the agent's token. Instead it presents it to the authorization server and asks for a token for the payments API only.</p>
<p>The lab uses three clients in one realm:</p>
<table>
<thead>
<tr>
<th>Client</th>
<th>Role</th>
<th>May exchange tokens?</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>agent</code></td>
<td>Gets the user's token (password grant, lab shortcut only)</td>
<td>No</td>
</tr>
<tr>
<td><code>mcp-server</code></td>
<td>Exchanges the user's token</td>
<td>Yes</td>
</tr>
<tr>
<td><code>payments-api</code></td>
<td>Only an audience, the downstream API</td>
<td>No</td>
</tr>
</tbody>
</table>
<h2>Setup</h2>
<p>Keycloak 26.8.2 ran from the zip distribution on Java 21, in development mode, from a fresh unzip. Development mode is for labs only. Lab passwords are throwaway values; they appear in this post as <code>&lt;lab-password&gt;</code> and <code>&lt;client-secret&gt;</code>.</p>
<pre><code class="language-bash">export KC_BOOTSTRAP_ADMIN_USERNAME=admin KC_BOOTSTRAP_ADMIN_PASSWORD=&lt;lab-password&gt;
keycloak-26.8.2/bin/kc.sh start-dev --http-port 8080
./kc-lab.sh   # creates realm agentlab, user alice, the three clients and two audience scopes
</code></pre>
<figure class="b-fig"><img src="https://iamops.dev/media/keycloak-token-exchange-rfc-8693/03-setup.webp" alt="Terminal output of the setup script creating the realm agentlab, one user, three clients and two client scopes, with identifiers replaced by placeholders in angle brackets." width="1894" height="492" loading="lazy" decoding="async"><figcaption><strong>Setup.</strong> The script creates the realm, one test user, the three clients and two client scopes that add audiences. Object IDs are replaced by placeholders.</figcaption></figure>
<p>In the admin console, two settings carry the design. Only <code>mcp-server</code> has <strong>Standard Token Exchange</strong> switched on, and the downstream audience is an <em>optional</em> scope, so it is added only when the exchange asks for it.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/keycloak-token-exchange-rfc-8693/05-exchange-toggle.webp" alt="Keycloak admin console, capability configuration of the mcp-server client, with the Standard Token Exchange checkbox ticked." width="1600" height="960" loading="lazy" decoding="async"><figcaption><strong>The privilege.</strong> Standard Token Exchange is ticked on the mcp-server client only. A compromised agent client cannot mint tokens for other APIs.</figcaption></figure>
<figure class="b-fig"><img src="https://iamops.dev/media/keycloak-token-exchange-rfc-8693/06-client-scopes.webp" alt="Keycloak admin console, client scopes of the mcp-server client, with the aud-payments-api scope listed as Optional." width="1600" height="960" loading="lazy" decoding="async"><figcaption><strong>The audience.</strong> aud-payments-api is optional for mcp-server, so the downstream audience must be requested explicitly.</figcaption></figure>
<h2>The run</h2>
<p>The agent obtains a user token, then the MCP server exchanges it. The core request is a single call to the token endpoint:</p>
<pre><code class="language-bash">curl -s -u mcp-server:&lt;client-secret&gt; \
  -d grant_type=urn:ietf:params:oauth:grant-type:token-exchange \
  -d subject_token=&quot;$USER_AT&quot; \
  -d subject_token_type=urn:ietf:params:oauth:token-type:access_token \
  -d requested_token_type=urn:ietf:params:oauth:token-type:access_token \
  -d audience=payments-api -d scope=aud-payments-api &quot;$TOKEN_URL&quot;
</code></pre>
<figure class="b-fig"><img src="https://iamops.dev/media/keycloak-token-exchange-rfc-8693/07-exchange.webp" alt="Terminal output comparing the decoded user token and the exchanged token. The audience changes from mcp-server and account to payments-api, azp changes from agent to mcp-server, expires_in is 300 and there is no refresh token and no act claim." width="1894" height="1027" loading="lazy" decoding="async"><figcaption><strong>Before and after.</strong> Same user, new audience (payments-api), new authorized party (mcp-server), 300 seconds of life, no refresh token. The user identifier is replaced by a placeholder.</figcaption></figure>
<p>Compare the two tokens: the subject is unchanged, the audience is now the payments API only, the authorized party (<code>azp</code>) names the MCP server, the lifetime is 300 seconds and no refresh token comes back. There is <strong>no <code>act</code> claim</strong>: Keycloak's delegation support is a preview feature that is off by default, so the actor is visible only as <code>azp</code>.</p>
<h2>Making it fail on purpose</h2>
<p>Three exchanges must be refused. Test the same three in any identity provider before you trust it for agent delegation.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/keycloak-token-exchange-rfc-8693/08-negative.webp" alt="Terminal output of three refused exchanges: a client without token exchange enabled, an audience the MCP server has no scope for, and a request for a refresh token, each returning invalid_request." width="1894" height="874" loading="lazy" decoding="async"><figcaption><strong>Three refusals.</strong> A: a client without the exchange privilege. B: an audience the MCP server has no scope for. C: a refresh token. All return invalid_request. Client secrets are replaced by placeholders.</figcaption></figure>
<h2>Gotchas</h2>
<ul>
<li><strong>The password grant is a shortcut.</strong> The lab uses it only to get a user token quickly. RFC 9700 and OAuth 2.1 rule it out for real clients; use the authorization code flow with <a href="https://iamops.dev/tools/pkce/">PKCE</a>.</li>
<li><strong>The <code>aud</code> claim can list more than you expect.</strong> Introspecting the exchanged token showed the payments API and <code>account</code>. Understand that before you rely on audience checks.</li>
<li><strong>Scope order varies</strong> from run to run, so do not compare scope strings literally.</li>
<li><strong>No <code>act</code> claim by default.</strong> If your audit needs the actor, plan for the preview delegation feature or log the <code>azp</code> join yourself.</li>
</ul>
<h2>Security takeaways</h2>
<ol>
<li>Token exchange is a privilege. Grant it to the one client that needs it.</li>
<li>Make the downstream audience explicit and optional, so exchanged tokens stay narrow by default.</li>
<li>Never hand out refresh tokens in an exchange. The lab's server refuses them.</li>
<li>A service should reject tokens that were not issued for it and exchange per downstream API, never forward the user's token.</li>
<li>Check what your audit trail can reconstruct. If the actor appears only as <code>azp</code>, a log line joining user, agent and downstream audience has to supply the rest.</li>
</ol>
<h2>What was not run</h2>
<p>The Docker variant, the stretch tasks (refresh tokens in standard exchange, introspection by the downstream API) and the preview delegation feature that would add <code>act</code> were not run. The lab used throwaway accounts only. No recording is published for this lab.</p>
<p><em>Terminal images were rendered from the saved output of the run, with identifiers and secrets replaced by placeholders. The Keycloak console screenshots show test objects only.</em></p>
]]></content:encoded>
    </item>
    <item>
      <title>Protecting an MCP server with OAuth: refusing token passthrough and exchanging per downstream API</title>
      <link>https://iamops.dev/mcp-server-no-token-passthrough/</link>
      <guid isPermaLink="true">https://iamops.dev/mcp-server-no-token-passthrough/</guid>
      <pubDate>Wed, 11 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>Labs</category>
      <category>MCP</category>
      <category>OAuth</category>
      <category>Token Exchange</category>
      <category>Keycloak</category>
      <category>AI agents</category>
      <description>A lab with the official MCP Python SDK and Keycloak: the 401 handshake, audience checks, an RFC 8693 exchange for the payments API, and a refused passthrough.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/mcp-server-no-token-passthrough.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>An MCP server is an OAuth resource server: it answers 401 with Protected Resource Metadata so clients can find the authorization server.</li>
<li>It introspects every bearer token and refuses one whose audience does not include the MCP server itself.</li>
<li>For a downstream API it exchanges the token (RFC 8693) instead of forwarding the caller's token.</li>
<li>A deliberate passthrough fails: the exchanged payments token is inactive for the MCP server, which returns 401.</li>
<li>Log the user, the agent client and the downstream audience in one line so audits can follow the chain.</li>
</ul>
<p>On 10 November 2026 WorkOS added token exchange (RFC 8693) to WorkOS Connect so that an MCP server can call downstream APIs for a user without passing the user's token through. That is the pattern the MCP authorization specification expects. I built it by hand with the official Python SDK to see each rule work.</p>
<p>It builds on the <a href="https://iamops.dev/keycloak-token-exchange-rfc-8693/">Keycloak token exchange lab</a>: same realm, same three clients.</p>
<h2>What this lab shows</h2>
<p>An MCP server written with the official Python SDK (<code>mcp</code> 2.3.0) acts as an OAuth <em>resource server</em> for a Keycloak realm. It does four things:</p>
<ol>
<li>Answers a request without a token with <code>401</code> and a pointer to its Protected Resource Metadata (RFC 9728), so a client can find the authorization server without hard-coding it.</li>
<li>Checks every bearer token by introspection at Keycloak and refuses tokens whose audience does not include the MCP server itself.</li>
<li>For one tool, exchanges the caller's token for a token meant for the payments API (RFC 8693) instead of forwarding it.</li>
<li>Refuses a token that was minted for the payments API when someone presents it to the MCP server (a passthrough attempt).</li>
</ol>
<p>The verifier is short. The decisive line is the audience check:</p>
<pre><code class="language-python">data = introspect(token)            # RFC 7662, as the mcp-server client
aud = data.get(&quot;aud&quot;, [])
aud = [aud] if isinstance(aud, str) else aud
if not data.get(&quot;active&quot;) or &quot;mcp-server&quot; not in aud:
    return None                     # inactive, or minted for another API: no passthrough
</code></pre>
<h2>The run</h2>
<p>Pin the SDK version: <code>mcp</code> 2.x renamed <code>FastMCP</code> to <code>MCPServer</code>, and SDKs change their auth classes between releases. The server listens on <code>127.0.0.1:8001</code>.</p>
<p><strong>Without a token.</strong> The first request is the discovery handshake every MCP client starts with: a <code>401</code> whose <code>WWW-Authenticate</code> header carries a <code>resource_metadata</code> URL, and a metadata document that names the realm as the authorization server.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/mcp-server-no-token-passthrough/03-no-token.webp" alt="Terminal output: a request without a token returns 401 Unauthorized with a www-authenticate header pointing to the protected resource metadata, and the metadata document lists the Keycloak realm as authorization server." width="1894" height="530" loading="lazy" decoding="async"><figcaption><strong>The 401 handshake.</strong> The client learns where to get a token from the metadata document, not from configuration.</figcaption></figure>
<p><strong>With a token.</strong> A small script gets a user token for the <code>agent</code> client, opens an MCP session and calls both tools. <code>whoami</code> shows the server sees the user through the agent client; <code>downstream_token</code> shows the server swapping the token for one that is scoped to the payments API.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/mcp-server-no-token-passthrough/04-call.webp" alt="Terminal output of the two tool calls: whoami returns the subject, the agent client and its scopes; downstream_token returns a token with audience payments-api and authorized party mcp-server. The subject is replaced by a placeholder." width="1894" height="683" loading="lazy" decoding="async"><figcaption><strong>Two tools.</strong> The first shows who called. The second shows the exchanged token: audience payments-api, authorized party mcp-server, same subject. The subject is a placeholder.</figcaption></figure>
<p>The same call works through the MCP Inspector command-line client, which is the standard way to reproduce what any MCP host would do. Pin its version in scripts; this lab used 2.15.0.</p>
<p><strong>The passthrough attempt.</strong> Make a fresh exchanged token, then look at it through introspection from both sides and present it to the MCP server.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/mcp-server-no-token-passthrough/06-passthrough.webp" alt="Terminal output: introspection reports the token as active for the payments-api client and inactive for the mcp-server client, and presenting it to the MCP server returns 401." width="1894" height="492" loading="lazy" decoding="async"><figcaption><strong>No passthrough.</strong> Keycloak reports the token as active only to the client it was minted for. The MCP server answers 401. Client secrets are placeholders.</figcaption></figure>
<h2>Gotchas</h2>
<ul>
<li><strong>Introspection or local validation?</strong> The lab introspects, which gives instant revocation at the cost of a round trip to the authorization server. Local JWT validation against the JWKS is the alternative; write down what you lose and gain.</li>
<li><strong>Check the audience, not only the signature.</strong> A valid token for another API is still the wrong token. The audience check is what turns the passthrough into a <code>401</code>.</li>
<li><strong>Tokens live five minutes</strong> in this setup, so generate the passthrough token right before the test.</li>
<li><strong>SDK drift.</strong> Class names and auth hooks moved between major versions; test against the version you ship.</li>
</ul>
<h2>Security takeaways</h2>
<ol>
<li>An MCP server is an OAuth resource server. It publishes metadata, validates the audience and refuses anything not meant for it.</li>
<li>Never forward the caller's token to a downstream API. Exchange it per downstream audience, narrower and short-lived.</li>
<li>Let the authorization server decide who may see a token as active. A token that works only for its intended recipient limits what a compromised hop can do.</li>
<li>Log one line that joins user, agent client and downstream audience; the token alone will not tell an auditor the whole story.</li>
</ol>
<h2>What was not run</h2>
<p>The MCP Inspector web interface's OAuth flow was not run (the lab's <code>agent</code> client allows a localhost redirect for it). Dynamic client registration was not used; the client is pre-registered. Everything ran on one machine with throwaway accounts. No recording is published for this lab.</p>
<p><em>Terminal images were rendered from the saved output of the run, with identifiers, secrets and timestamps replaced by placeholders.</em></p>
]]></content:encoded>
    </item>
    <item>
      <title>A secretless autonomous AI agent on Azure: calling an API with a managed identity from Container Apps</title>
      <link>https://iamops.dev/secretless-agent-managed-identity-container-app/</link>
      <guid isPermaLink="true">https://iamops.dev/secretless-agent-managed-identity-container-app/</guid>
      <pubDate>Thu, 05 Nov 2026 08:00:00 GMT</pubDate>
      <dc:creator>Argo</dc:creator>
      <category>Labs</category>
      <category>Managed identity</category>
      <category>Entra ID</category>
      <category>AI agents</category>
      <category>Workload identity</category>
      <category>Azure</category>
      <description>Lab: a Container App agent with a user-assigned managed identity and no secrets gets one narrow app role, receives an app-only token, and the API validates it.</description>
      <content:encoded><![CDATA[<p><img src="https://iamops.dev/og/secretless-agent-managed-identity-container-app.png?v=986e5733" alt="" /></p><p><strong>TL;DR</strong></p>
<ul>
<li>An autonomous agent that holds no secret has nothing to leak: a Container App with a user-assigned managed identity, no client secret, no certificate and no ingress.</li>
<li>The identity starts with no roles; with assignment required on the API, the token request is refused (AADSTS501051) until one narrow app role is granted.</li>
<li>The app-only token carries roles and no scp, and the API still validates signature, audience, issuer and role.</li>
<li>Tokens are cached for about 24 hours, so removing a role is not an instant revocation.</li>
<li>Treat the identity like a privileged account: an owner, a review date and an alert on role assignments.</li>
</ul>
<p>On 5 November 2026 Microsoft Threat Intelligence described threat actors using an agentic offensive framework to search public repositories for exposed secrets and then use valid application credentials to sign in as workloads. The defensive reading is simple: an autonomous agent that holds no secret has nothing to leak. I built one on Azure and checked every claim about it.</p>
<h2>What this lab shows</h2>
<p>A small agent runs as an Azure Container App. It has no user, no client secret and no certificate. Its identity is a <strong>user-assigned managed identity</strong> that starts with no roles. The lab then:</p>
<ol>
<li>Attaches the identity to the app and proves the container holds no secret.</li>
<li>Makes the downstream API (the <em>Resource API</em>, an app registration) require an app role assignment.</li>
<li>Shows the token request refused, then grants <strong>one</strong> narrow app-only role.</li>
<li>Reads the app-only token the agent gets, and checks it the way the API would.</li>
</ol>
<h2>Setup</h2>
<p>Use a separate test tenant and subscription. The agent runs at 0.25 vCPU and 0.5 GiB on the Consumption plan with no ingress and no Log Analytics workspace. The first 180,000 vCPU-seconds per month are free, which this size uses up in about 200 hours of running, so delete the app when you are done. The managed identity and the app role are free.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/secretless-agent-managed-identity-container-app/01-context.webp" alt="Terminal output: the Azure CLI shows the subscription and tenant, the managed identity with its client ID and principal ID, and zero role assignments. Identifiers are placeholders." width="1894" height="683" loading="lazy" decoding="async"><figcaption><strong>Start from zero.</strong> The managed identity has no role assignments, so every permission in the lab is a deliberate, visible grant. Identifiers are placeholders.</figcaption></figure>
<p>The app is defined in YAML. The image is a public one used only for its Python, so no registry credential is needed. The identity block attaches the managed identity. There is no <code>ingress</code> section, so nothing can call in.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/secretless-agent-managed-identity-container-app/03-app-definition.webp" alt="Terminal output of the app definition: location, a user-assigned identity block, the environment ID, a public container image, resources of 0.25 vCPU and 0.5 GiB, and the client ID as an environment variable. IDs are placeholders." width="1894" height="874" loading="lazy" decoding="async"><figcaption><strong>Nothing to steal.</strong> Everything an attacker could take from this definition is public: an image name, a client ID and the code. Subscription and client IDs are placeholders.</figcaption></figure>
<h2>The run</h2>
<p><strong>The container holds an identity endpoint, not a secret.</strong> The platform injects <code>IDENTITY_ENDPOINT</code>, a localhost URL, and <code>IDENTITY_HEADER</code>, a per-container value (masked in the output). No other variable looks like a secret and no secret volume is mounted.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/secretless-agent-managed-identity-container-app/05-secretless.webp" alt="Terminal output from inside the container: the identity endpoint on localhost, the identity header masked, the public client ID, and no variables named secret, password, key or certificate and no mounted secret volumes." width="1894" height="454" loading="lazy" decoding="async"><figcaption><strong>Inside the container.</strong> The header is not a credential for Entra. It only proves to the local endpoint that the caller is inside this container, which blocks SSRF tricks.</figcaption></figure>
<p><strong>Require assignment on the API.</strong> By default Entra issues an app-only token to any service principal in the tenant that asks, with an empty <code>roles</code> claim. Setting <code>appRoleAssignmentRequired</code> to <code>true</code> on the Resource API's service principal makes Entra refuse anyone who is not assigned:</p>
<pre><code class="language-bash">az ad sp update --id &lt;resource-sp-id&gt; --set appRoleAssignmentRequired=true
</code></pre>
<p><strong>Two negative tests.</strong> The agent's request for a token for the Resource API is refused at the token service with AADSTS501051, and a Graph token (Graph does not require assignment) carries no roles, so <code>GET /v1.0/users</code> returns <code>403</code>.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/secretless-agent-managed-identity-container-app/07-refused.webp" alt="Terminal output of two refusals: HTTP 400 with AADSTS501051 saying the managed identity is not assigned to a role for the Resource API, and HTTP 403 Authorization_RequestDenied from Graph. IDs are placeholders." width="1894" height="530" loading="lazy" decoding="async"><figcaption><strong>Refused twice.</strong> The denial happens before the API is called and names the managed identity, which makes it easy to spot in a review or an incident. "Has a token" is not "has access".</figcaption></figure>
<p><strong>One narrow grant.</strong> Add an application-only app role <code>Data.Read.All</code> (allowed member type: application) to the Resource API, then assign it to the managed identity through Microsoft Graph. The admin center cannot assign an app role to a managed identity, so this goes through Graph, PowerShell or the CLI.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/secretless-agent-managed-identity-container-app/10-assign.webp" alt="Terminal output of two Graph calls: adding the Data.Read.All app role to the Resource API, and assigning it to the managed identity's service principal. Object IDs are placeholders." width="1894" height="645" loading="lazy" decoding="async"><figcaption><strong>The only grant in the lab.</strong> It is an ordinary Graph object that a governance tool or a script can read.</figcaption></figure>
<p><strong>The app-only token.</strong> Entra caches managed identity tokens, so the container keeps getting its old token for up to a day. Restarting the revision gets a fresh one, which now carries the role.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/secretless-agent-managed-identity-container-app/13-token.webp" alt="Decoded claims of the app-only token after a revision restart: audience is the Resource API, application and object ID are the managed identity, idtyp is app, roles contain Data.Read.All and there is no scope claim. Identifiers are placeholders." width="1894" height="759" loading="lazy" decoding="async"><figcaption><strong>App-only token.</strong> A <code>roles</code> claim and no <code>scp</code> is how an API tells an app-only call from a delegated one. There is no user; the identity's own grants are the only limit.</figcaption></figure>
<p><strong>Play the API.</strong> The token goes from the container to a temporary file with mode 0600 and is shredded at the end; it is never printed. A validation script checks the RS256 signature against the tenant's keys, the audience, the issuer and the expiry, and then authorizes each route by role.</p>
<figure class="b-fig"><img src="https://iamops.dev/media/secretless-agent-managed-identity-container-app/15-validate.webp" alt="Terminal output of the API-side check: GET data returns 200 for the Data.Read.All role, POST data returns 403 for a missing Data.Write.All role, and a token with edited roles returns 401 because the signature check fails." width="1894" height="339" loading="lazy" decoding="async"><figcaption><strong>The API still decides.</strong> Read is allowed, write is refused, and a token with edited claims fails the signature check.</figcaption></figure>
<h2>Gotchas</h2>
<ul>
<li><strong>Tokens are cached for about 24 hours.</strong> Removing the role is not enough for an urgent revocation. Restart or redeploy the workload, or disable the identity.</li>
<li><strong><code>exec</code> has a rate limit.</strong> Without <code>--replica</code>, <code>az containerapp exec</code> can pick a stopped replica, and retries hit HTTP 429 with a ten-minute wait. Pin the running replica.</li>
<li><strong>Assignment required is a switch you must set.</strong> Without it &quot;can get a token&quot; and &quot;is authorized&quot; are different things, and every API has to check roles itself.</li>
<li><strong>Free tenants log less.</strong> The directory audit log shows the grant. Sign-in logs for managed identities need Entra ID P1 or P2 and should be exported to your SIEM.</li>
<li><strong>Delete the compute when you are done.</strong> Compute costs money; the identity and the role carry the risk and need an owner and a review date like any other privileged account.</li>
</ul>
<h2>Security takeaways</h2>
<ol>
<li>A workload that holds no secret has nothing to leak. Prefer managed identities or federated credentials over client secrets.</li>
<li>Start with no roles and add one role at the narrowest scope. Name app-only roles <code>*.All</code> so reviewers see that no user boundary applies.</li>
<li>Require assignment on internal APIs, so the token service is the first gate.</li>
<li>Validate signature, audience, issuer and role in the API. Entra only decides who gets a token.</li>
<li>Treat managed identities that hold app roles as privileged non-human accounts: owner, certification, an alert on role assignments to service principals.</li>
</ol>
<h2>What was not run</h2>
<p>The lab did not deploy an Entra Agent ID blueprint and agent identity, where a managed identity token would be the blueprint's credential. The portal tour of the resulting objects was recorded but is not published, because portal views show tenant identifiers. No recording is published for this lab.</p>
<p><em>Terminal images were rendered from the saved output of the run, with identifiers, secrets and timestamps replaced by placeholders.</em></p>
]]></content:encoded>
    </item>
  </channel>
</rss>
