Skip to content

IBAC: Default no_intent_policy should be deny, and LastIntent is vulnerable to concurrent session overwrites #467

Closed as not planned

Description

@rhuss

Summary

Two related issues with IBAC's intent correlation that weaken its security guarantees under concurrent and multi-tenant usage.

1. no_intent_policy default should be deny, not allow

When IBAC is explicitly enabled in the pipeline and no A2A session could be established (no inbound A2A message has populated a session bucket), the current default behavior is allow: the request passes through with a no_user_context skip reason.

The rationale in the code is that IBAC targets prompt-injection attacks which require a user in the first place, and legitimate self-actions (initialization, machine-to-machine calls, headless cron flows) should not be blocked.

I disagree with this default. If an operator has explicitly enabled IBAC, they are opting into intent-based access control. Silently passing through all traffic when no session exists defeats the purpose. An agent that somehow ends up without a session (misconfiguration, session expiry, protocol mismatch) should fail closed, not open.

Proposed change: Default no_intent_policy to deny. Operators who need the allow behavior for headless/cron agents can explicitly set no_intent_policy: allow in their config. The current default creates a false sense of security: IBAC is enabled but silently inactive for any traffic without an A2A session.

2. LastIntent is vulnerable to concurrent overwrites within the same session

LastIntent() returns the most recent inbound A2A user message by scanning SessionView.Events backward. The Store.Append() method is mutex-protected (sync.RWMutex), so concurrent appends to the same session are safe from data races. However, the semantic problem remains:

If two inbound A2A messages arrive concurrently for the same session ID (e.g., a user sends a second task before the first completes), LastIntent() returns whichever was appended last. Any outbound calls from the first task's processing that are evaluated after the second intent is recorded will be judged against the wrong intent.

The code acknowledges this in the Rekey method comment:

Assumes single-tenant, no concurrent conversations per pod. In a multi-tenant deployment two in-flight first-turn requests could both land under "default"; rekeying the first to arrive would strand the second's events.

And the DefaultSessionID constant comment:

This collapses all such requests into one shared session, which is correct for single-agent pods but may cause cross-user correlation in multi-tenant deployments.

For single-agent, single-user-at-a-time Pods, this works. For multi-tenant or concurrent-user scenarios, IBAC's intent correlation breaks silently. The agent could make an outbound call aligned with User B's intent while acting on behalf of User A, and IBAC would allow it because it is comparing against the wrong intent.

Questions to resolve:

  • Can the A2A protocol guarantee that concurrent messages to the same session ID do not happen? If so, this is a protocol-level invariant we can rely on.
  • If concurrent messages within a session are possible, should IBAC track intent per-task (task_id) rather than per-session? The A2A parser already extracts task_id.
  • Should the session store support intent stacking (a stack of active intents per session, popped as tasks complete) rather than a single LastIntent?

Relevant code

  • IBAC plugin: authbridge/authlib/plugins/ibac/plugin.go (lines 76-100 for NoIntentPolicy, lines 420-480 for intent extraction)
  • Session store: authbridge/authlib/session/store.go (DefaultSessionID constant, Append method, Rekey comment)
  • Session view: authbridge/authlib/pipeline/session.go (LastIntent() method)

Impact

Both issues affect IBAC's ability to fulfill its stated threat model (catching prompt-injection attacks where an LLM emits user-misaligned actions). The first issue makes IBAC silently inactive in common scenarios. The second makes it compare against the wrong intent under concurrency.

Activity

  1. huang195 commented on Jun 3, 2026

    @huang195
    Member

    @rhuss thanks for the input. Will investigate these findings.

  2. github-actions commented on Aug 8, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this issue is still relevant, please comment or remove the stale label.

  3. github-actions commented on Aug 23, 2026

    @github-actions
    Contributor

    This issue was closed because it has been stale for 14 days with no activity. Feel free to reopen if this is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions