Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Tracing and stopping an agent

A week after the photo book arrives, your Lisbon album has a public sharing link you do not remember making. This lesson reads the record that tells you who made it, lists what a useful audit trail for agents keeps and leaves out, follows what stops when you revoke an agent and what does not, and ends with the agent's lifecycle.

What happened to my album?

The photo book arrives, and it is lovely. A week later, though, you notice that your Lisbon trip album has a public sharing link. You do not remember creating one. You do remember the strange caption your friend's photos carried. Did the assistant share your album after all?

You need answers to the questions from What makes an agent different, this time looking back. Who created the link? When? Acting for whom, and with what authority? If the photo service only recorded "user-2048 created a sharing link", you could not tell whether that was you or something acting for you.

The photo service shows you the album's activity. Because the assistant reached your album as your delegate, every entry records both whose authority was used and who used it:

Activity on the Lisbon trip album
Time (UTC)ActionForActingOutcome
Sep 24, 18:31Create public sharing linkYouYou, in the photo web appAllowed
Oct 1, 14:02Read albumYouassistant.exampleAllowed
Oct 1, 14:06Create public sharing linkYouassistant.exampleRefused: the token does not allow sharing
Oct 1, 14:20Read albumYouPrinter's selection agent, for assistant.exampleAllowed

All domains, credentials, and tokens in these examples are fictional. The link was yours. You created it on the last day of the trip, from the photo web app, so your family could see the photos, and then forgot about it. The assistant did try to share the album on October 1, steered by the caption, and the photo service refused. In a record that showed only whose authority was used, both share rows would read "you created a sharing link." A record that also says who acted tells them apart.

An audit trail that answers the questions

Each entry in a useful trail for agent actions records:

  • When, from the server's clock.
  • What: the action and the resource it touched.
  • For whom: the subject whose authority was used.
  • Who acted: the client and the full chain of actors, current and earlier.
  • With what authority: which grant was used, what it allowed, and a reference to any approval, such as your approval of the book order.
  • The outcome, including refusals and failures. The refused share is one of the most informative entries in the table.
  • A request identifier, and a reference to the request that caused this one, recorded at each service, so related operations can be joined up later. Each request keeps its own entry, and the reference is an identifier, never a credential.

The trail should never contain tokens, codes or other credentials. It should also leave out the contents of the agent's conversation and of your photos. A record of what happened does not need a copy of everything that was said or seen, and keeping one creates a new store of private data to protect.

The printer keeps a matching record of its side. Its entry for the order says that assistant.example placed order ord-5531 for draft book-7730 for you at $58.00, under the recorded decision approval-7730, linked to that order. What it leaves out matters as much: the binding message shown on your phone, the CIBA request identifier, the credential used to notify your phone and every token stay out of the record.

Revoking an agent

Even though the link was yours, the episode makes you check what can still reach your photos. You open the photo service's list of connected apps, and the assistant is not on it. Its grant ended after the 24 hours you approved, and when the book was finished, the assistant had already revoked its own refresh token:

POST /revoke HTTP/1.1
Host: auth.photos.example
Content-Type: application/x-www-form-urlencoded

client_id=assistant
&client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer
&client_assertion=demo-signed-client-assertion
&token=demo-assistant-refresh-token
&token_type_hint=refresh_token

This is the same request any client sends in Token revocation. A well-behaved agent does not wait to be revoked. But suppose the assistant had kept a standing grant, and you removed it from the list. Here is what would stop, and when.

The grant would end at once. The photo service would delete your grant to the assistant, and its refresh token would stop working. The assistant's next attempt to refresh would fail with invalid_grant, as in The refresh token grant.

Access tokens already issued might last a little longer. If the photo API checks each token with the authorization server, as in Token introspection, a revoked grant takes effect on the next request. If it validates signed tokens locally, it still checks the signature, issuer, audience, times and its own rules, but it has no way to learn that the grant was revoked, so a token issued before you revoked keeps working until it expires, up to fifteen minutes here. Short lifetimes, or checking tokens with the authorization server before sensitive actions, keep that window small.

Tokens derived from the grant should end with it. The selection agent's token was exchanged from the assistant's. A careful authorization server revokes tokens derived from a grant when the grant is revoked. Otherwise they last until they expire, which is another reason derived tokens should be short-lived.

The operator has its own switch. assistant.example can stop the assistant's tasks for you directly. If the assistant's own software were compromised, the operator would treat it as a leaked workload credential, as in Owning and retiring workload identities: revoke its client credentials at every service, look for anything the attacker created, and replace them.

What revocation cannot undo

Revocation stops what an agent does next. It does not reverse what it has already done. Removing the assistant does not cancel the book order. That is a separate request to the printer, under the printer's cancellation policy. It does not delete copies of your photos the printer's selection agent made while choosing pages. Those are governed by the printer's own retention rules. And it cannot unsend a message or make a shared file private again in every place it has been copied to.

That is why the controls that matter most come before an agent acts: narrow grants that limit what it can do, and approvals for the actions that cannot be undone. Afterwards, the audit trail tells you what needs repairing.

Retiring an agent

Agents are identities with a lifecycle, like the workloads in Owning and retiring workload identities. Each one needs an owner: the operator for the agent itself, and you for the authority you delegated to it. Each needs an inventory. Your list of connected apps is your inventory of agents holding your authority, and an organization should keep one for every agent it runs or allows. Each needs review: grants that have not been used in months should be removed. And each needs retirement: when an agent is no longer used, its grants are revoked, its client registrations and credentials are deleted, and its history is kept.

An agent nobody owns, holding standing grants from many people, is the agent version of migrate-tmp. It keeps working quietly, and nobody is watching what it can do.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

You revoke the assistant's grant, but its access token still works for six more minutes at a photo API that validates tokens locally. Why, and what shortens that window? 1 of 3

Choose one answer.

Which record lets you tell "you shared the album" apart from "the assistant shared it for you"? 2 of 3

Choose one answer.

You remove the assistant from your connected apps after it ordered the photo book. What happens to the order? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity