← All posts

A valid token, a revoked consent, and an agent that stopped: Preloop with LifeCare.ID®

Dimitris Moraitis · ·5 min read
  • AI agent governance
  • consent
  • OAuth token introspection
  • MCP firewall
  • audit trail

On 27 October at 14:47:39 UTC an agent read one person's daily health summary. Three seconds later it asked for the same thing and was refused.

Nothing about the agent had changed. It had the same token, made the same request and ran the same code. What changed was on the other side: in those three seconds the person withdrew their consent. Nobody told the agent. It just stopped being allowed.

The person was synthetic. The two systems were real, and so were the records each of them kept.

Preloop is an open source control plane for AI agents. It sits in front of an agent's tool calls, checks each call against a policy, and writes every call to an audit log. LifeCare.ID®, built by Raphael Gernot, is a consent layer for personal health data. This post is about what happens when you put the first in front of the second.

A token is a memory of a permission

An agent holds a token. The token says what the agent may read. But the permission behind it belongs to someone else, and that person can change their mind.

A token is checked when it is issued and trusted until it expires. LifeCare.ID® keeps that window short: its tokens last at most twenty minutes. That is still twenty minutes in which an agent can act on a permission that no longer exists, and an agent does not pause to wonder.

Health data is where this matters first. In the US much of what a provider or a researcher does with a person's health data needs that person's consent or authorization. When the consent goes, the access should go with it, at once and not when a timer runs out.

Who decides

In LifeCare.ID® the person holds the grants. Every grant writes a receipt, and every read writes a line in a ledger the person can open. The person can revoke a grant at any time.

Preloop does not decide whether a person consented, and it should not. Raphael put the line between the two systems this way: "Preloop may refuse a call. It never widens what the token allows."

So Preloop asks. Before each call to the data source, it asks LifeCare.ID®'s authorization server whether the grant behind the token is still active and what it covers. This is standard OAuth token introspection (RFC 7662). Both caches are set to zero, so every call gets a fresh answer.

What the two records say

Raphael ran the first test from his side, against his sandbox source, behind an agent on Preloop Cloud. This is what the two systems recorded.

Time (UTC) Agent asks Preloop LifeCare.ID®
14:47:39 daily summary allowed, grant active served, ledger line written
person revokes
14:47:42 daily summary refused, grant inactive never called
14:48:44 daily summary, grant active again allowed, grant active served, ledger line written
person revokes
14:48:47 daily summary refused, grant inactive never called

A third pair at 15:41 gave the same result.

Look at the last column of the refused rows. The source was never called. The agent's request stopped at Preloop, and nothing touched the person's data.

For the reads that were served, the two records meet on the consent id and the time. An auditor on either side can start from their own record and find the matching line in the other.

The same test, without the person in our records

That first run had a flaw on our side. Reference-only logging was off, so Preloop's audit rows stored the call arguments in clear, including the synthetic person's identifier. Preloop stored no part of the result, but a consent record should not need a copy of the identifier either.

On 16 November I ran the same scenarios on a self-hosted Preloop 1.0.2, the open source edition, installed with the release installer and telemetry off. This time reference-only logging was on and kept two fields from the result: the consent id and the ledger entry hash.

  • The audit row for the served read holds both values. Both equal the data access line in the synthetic person's ledger.
  • The person's identifier, which the agent passed as an argument, occurs nowhere in a full dump of Preloop's database. The row keeps the argument names and a salted hash of their values. One caveat for 1.0.2: the application log of the api container still prints a call's arguments, and the fix is merged for the next release.
  • The person revoked at 18:15:28 UTC. The next read was refused at Preloop's gate as an inactive grant. Preloop did not call the source, and the ledger got no line.

On 17 November I added one more condition to the tool: allow the granted scope, deny everything else. A read of a scope outside the grant was refused by Preloop. A packet capture of that call shows one connection, to the introspection endpoint, and none to the source.

Neither side issued the other's credentials.

"The source would refuse anyway"

It would. Before introspection was switched on, a read after revoke reached Raphael's source and came back 401. So why put a gate in front?

Two reasons. First, a revoked agent now stops on its own side. It does not keep knocking on a door that holds someone's health data. Second, the operator of the agent gets its own evidence, in its own log, that the agent stopped when the permission did. When someone asks "what did your agent do after consent was withdrawn?", the answer is a row, not a promise.

Try it

The configuration is in our docs: Consent-gated tool calls with LifeCare.ID®. LifeCare.ID®'s side is in its developer documentation: sandbox data source. Preloop is open source: github.com/preloop/preloop.