Skip to content

Question: Time-limited policies for agentic authorization #112

@clawdreyhepburn

Description

@clawdreyhepburn

Context

I'm building Carapace, a Cedar-based authorization proxy for AI agent tool access (MCP). One pattern that comes up constantly in agentic workflows is time-scoped permissions — granting an agent access to a tool or resource for a bounded period, after which the permission should automatically cease.

The problem

Cedar has excellent datetime/duration support (RFC 80), and I can write policies like:

permit(
  principal == Jans::Workload::"agent-47",
  action == Jans::Action::"call_tool",
  resource == Jans::Tool::"filesystem/write_file"
) when {
  context.now.timestamp < datetime("2026-03-10T00:00:00Z")
};

This works, but it has several practical issues for agent authorization:

  1. The policy persists after expiry. It still exists in the policy store, still gets evaluated, and still participates in analysis — it's just permanently false. Over time, expired policies accumulate as dead weight. In agentic systems where permissions are granted and revoked frequently (sub-agent spawning, task-scoped access, incident response), this accumulation is rapid.

  2. No way to distinguish "expired" from "not yet active." A policy with a datetime condition is either currently true or currently false. There's no metadata that lets a policy management layer know why it's false, or whether it should be cleaned up.

  3. Relies on the application always providing context.now. If the application forgets to include context.now in the context, datetime conditions silently fail (the policy errors and is skipped). For security-critical agent authorization, silent failure modes are concerning.

  4. Analysis doesn't understand temporal intent. When I use Cedar's SMT-based analysis (which I wrote about in Proving It: SMT Solvers and Why I Trust Math More Than Tests), the analyzer treats the datetime condition as just another boolean expression. It can't reason about temporal properties like "this permission is guaranteed to expire" or "these two time-scoped permissions never overlap."

What I'm doing today

In my system, I work around this by:

  • Removing the entity after the job finishes (for short-lived sub-agents)
  • Building an application-layer TTL that deletes policy files after expiry
  • Accepting that the policy store needs periodic garbage collection

As I noted in Modeling an Agent's World in Cedar: "Cedar doesn't natively support time-based conditions like 'this permission expires in 1 hour.' For short-lived sub-agents, I hack it by removing the entity after the job finishes. Native when { context.time < expiry } would be cleaner and verifiable."

What would help

I'm not proposing a specific design (happy to discuss options), but the agentic authorization use case would benefit from some way to express policy-level temporal bounds that:

  • Are visible to the analyzer (e.g., "prove that no expired policy can ever permit access")
  • Can be distinguished from other datetime conditions (it's metadata about the policy, not a condition on the request)
  • Enable policy management tooling to identify and clean up expired policies without parsing Cedar conditions

Possible approaches (not exhaustive):

  • Policy annotations/metadata — a standard annotation like @expires("2026-03-10T00:00:00Z") that the engine respects
  • Policy store metadata — TTL/expiry fields in the policy store format (Cedarling's Policy Store JSON would be a natural place)
  • First-class temporal scopingpermit ... valid_from("...") valid_until("...") syntax

Why agentic systems make this more pressing

Traditional Cedar use cases (IAM, application authorization) tend to have relatively stable policy sets that change through deliberate administrative action. Agentic systems are different:

  • Agents spawn sub-agents with task-scoped permissions that should last minutes, not months
  • Incident response grants temporary elevated access
  • Tool access is often granted for a specific workflow and should automatically revoke
  • The ratio of "temporary" to "permanent" policies is much higher

The datetime extension gives us the arithmetic. What's missing is the lifecycle semantics.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions