Dev.to AI šŸ¤– Ai šŸ‘ 0 šŸ“– 2 min read

Fixing a Cross-Tenant Approval Isolation Gap in RagLeap Agents 0.5.1

Fixing a Cross-Tenant Approval Isolation Gap in RagLeap Agents 0.5.1 What happens when one tenant can resume another tenant's paused AI agent run? We reproduced that scenario in RagLeap Agents 0.5.0. The result was a

Fixing a Cross-Tenant Approval Isolation Gap in RagLeap Agents 0.5.1

What happens when one tenant can resume another tenant's paused AI agent run?

We reproduced that scenario in RagLeap Agents 0.5.0. The result was a security improvement focused on scope-bound execution and approval isolation, released as RagLeap Agents 0.5.1.

The vulnerability scenario

Consider a shared agent instance and state store:

  1. Tenant A starts an agent run.
  2. The run pauses while waiting for approval to execute a tool.
  3. Tenant B obtains the run ID and attempts to resume it.
  4. The previous implementation does not bind run() or resume() to a tenant scope.

Because the shared state store was keyed by run ID alone, the second tenant could resume the first tenant's paused run and trigger the pending tool with the original arguments.

This was a reproduced cross-tenant isolation gap in shared-store usage.

The fix: bind execution to scope

RagLeap Agents 0.5.1 adds scope-aware run and resume APIs:

agent.run(task, scope="tenant-a")

agent.resume(
    run_id,
    decisions,
    scope="tenant-a"
)

The scope is persisted with the run. Resume requests must match it.

Wrong-scope requests, unknown runs and damaged state return the same error:

ResumeError("unknown run")

This avoids exposing whether a run exists under a different tenant.

Additional security improvements

Stronger run IDs

New run identifiers are 22-character URL-safe tokens with 128 bits of randomness. Existing 12-character hexadecimal IDs remain supported for compatibility.

Mandatory scope mode

Applications can opt into mandatory scope enforcement:

Agent(..., require_scope=True)

Audit and rate limiting

The release introduces:

  • AuditLog(...): operational metadata without recording content text.
  • RateLimiter(...): per-scope limits applied before model calls.
  • Sub-agent scope inheritance: child agents retain their parent's scope.

The release adds ragleap-security>=0.2.0, which uses the Python standard library.

How we tested it

The reported verification included:

Check Result
Test suite 251 passed
GitHub CI 55/55 checks
Mutation tests — Python 3.12.3 34/34 killed
Mutation tests — Python 3.10.20 34/34 killed
Published wheel source comparison Verified
Cross-tenant resume using published wheel Rejected
Legacy 0.5.0 run-state compatibility Tested

We also ran the tests against the published wheel, not just the source checkout.

What this release does not guarantee

Scope enforcement is not a complete authentication system.

The application must authenticate users and pass the correct scope. A shared state-store file still relies on filesystem permissions; separate stores per tenant offer stronger separation. The rate limiter is in-memory, so its state does not survive restarts.

Windows, macOS, real model-provider execution and network filesystems were not verified in the reported release testing. Independent security review remains necessary.

Why we're sharing this

Agent security needs to cover more than prompt injection and tool permissions. It must also account for who owns a run, who can resume it, and whose approval authorizes an action.

RagLeap Agents 0.5.1 makes those boundaries explicit and adds regression coverage for the reproduced issue.

Get the release

RagLeap is open-source and self-hosted. We welcome developers and security practitioners who want to inspect, test and contribute.

Build agents that can act. Make sure they act within the right boundaries.

šŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.