Identity · Scope · Integrity
What if Asimov wrote the security spec for your AI agent?
Senior Developer Advocate · Auth0
Hoosier living in the big city. Corgi dad. Passionate about education, mentoring at hackathons, and building things live on Twitch.
A robot may not injure a human being or, through inaction, allow a human being to come to harm.
A robot must obey orders given it by human beings except where such orders would conflict with the First Law.
A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.
Asimov was worried about robots harming people. I'm worried about what AI agents will do with your credentials.
Today we rewrite these laws as Identity, Scope, and Integrity.
"If identity is compromised,
every other security policy fails."
"An agent must always maintain a unique, verifiable identity and must never act anonymously or under a masked provenance."
sub)"An agent must only perform actions within its explicitly delegated permissions, except where such actions would violate the Law of Identity."
gmail.readonly, not admin"An agent must protect its own credentials and session tokens, as long as such protection does not conflict with the First or Second Laws."
An agent must always maintain a unique, verifiable identity and must never act anonymously or under a masked provenance.
The Foundation: Without a verifiable identity, no other security policy can be trusted.
An agent must only perform actions within its explicitly delegated permissions, except where such actions would violate the Law of Identity.
The Hierarchy: You cannot grant "permissions" to an entity that hasn't first proven who it is.
An agent must protect its own credentials and session tokens, as long as such protection does not conflict with the First or Second Laws.
The Guardrail: An agent shouldn't "hide" its identity or bypass scopes even in the name of "self-preservation" or efficiency.
Enforcement lives in the identity layer — not in your application code.
Apex — Law III: Integrity
CIBA async authorization · Human approval flow · Credential isolation
Middle — Law II: Scope
Token Vault · Scoped access tokens · Least privilege at the identity layer
Foundation — Law I: Identity
Verified login (OIDC) · Subject ID (sub) · Identity tokens · Root of trust
A single tool definition demonstrating all three laws:
All Three Laws in Action
TypeScript · Vercel AI SDK · Auth0 for AI Agents
The auth0 middleware gates every request. No valid session = redirect to login.
subThe withGmailRead wrapper binds a scoped token to the tool — the agent can read, but cannot send or delete.
gmail.readonlyshopOnlineTool
"By following these Three Laws, we move from 'Unconstrained AI' to
Verifiable Autonomy."
We aren't just building agents that work — we're building agents we can trust with our credentials.
"Which of the three laws is your current agent violating right now?"