Principal binding is the practice of tying every action an AI agent takes to a specific, identifiable principal. A principal is the entity responsible for the action: a user, an agent identity, or a service account. Without principal binding, actions float without attribution, making accountability impossible.
When an AI agent sends an email, who sent it? When an agent modifies a database record, who made the change? When an agent triggers a deployment, who authorized it?
Without principal binding, the answer is "the agent" which tells you nothing about who instructed the agent, what permissions should apply, or who is responsible for the outcome.
In a typical agent interaction, there are multiple principals:
Principal binding creates a chain that links all three:
User (user_123) → Agent (agent_support_v2) → Tool (database, via service_db_readonly)
Every receipt in the audit trail includes this principal chain, making it possible to trace any action back to its origin.
Pass principal information as context when creating the guard:
const guard = createGuard({
policy,
context: {
principal: {
user: 'user_123',
agent: 'agent_support_v2',
role: 'support',
sessionId: 'sess_abc',
}
}
});
Policies can match on principal attributes:
rules:
- tool: "customer.delete"
action: allow
when:
context.principal.role:
equals: "admin"
- tool: "customer.delete"
action: block
reason: "Only admin agents can delete customers"
Regulatory frameworks require that actions are attributable. The EU AI Act requires "traceability" of AI system decisions. SOC 2 requires that access and actions are logged with identity information. HIPAA requires that access to patient data is attributed to specific users.
Principal binding satisfies these requirements by ensuring every action in the audit trail is linked to identifiable entities.
Some systems run agents under the user's identity. This is convenient but dangerous. It means the agent has the user's full permissions, and actions by the agent are indistinguishable from actions by the user.
Better practice is to give agents their own identities with scoped permissions. The agent acts "on behalf of" the user but with its own credential set. The receipt records both the user who requested the action and the agent identity that executed it.
Explore more guides on AI agent safety, prompt injection, and building secure systems.
View All Guides