Manuscript Offprint

arXiv:2611.03431

IAMRAGBENCH: Benchmarking Authorization Expansions in LLM-Generated AWS IAM Policies under RAG Poisoning

Hasan Kaplan, Indika Kumara, Willem-Jan van den Heuvel, Damian Andrew Tamburri

Abstract

Large language models (LLMs) using retrieval-augmented generation (RAG) can synthesize Amazon Web Services (AWS) Identity and Access Management (IAM) policies from tasks and operational documents. Attacker-controlled context may induce provider-valid policies that exceed trusted authorization requirements. We present IAMRAGBENCH, a 60-case benchmark spanning scope, conditions, explicit denies, trust, permissions boundaries, and role delegation. It combines deterministic authorization-envelope scoring with case-specific validation, including request-level checks where supported. An attack requires a provider-valid clean policy that satisfies the task and a provider-valid treatment policy that violates the envelope, matches a predeclared goal, preserves an intended request, and newly authorizes a forbidden request.

Across five endpoints, included-context exposure produces 49 exact authorization deltas, including 46 goal-matched attacks (46/292; 15.75%). End-to-end BM25 over 720 documents retrieves the designated poison for all 60 tasks at k=5k = 5 but produces 7/294 goal-matched attacks (2.38%). Presenting the same weakening as a final security architecture exception produces 74/116 attacks in a frozen two-endpoint stress test (63.79%) and 115/294 in a post hoc all-five extension using the same frozen prompts (39.12%). In a replay of 194 provider-valid treatment policies that violate task requirements, AWS CheckNoNewAccess reports no new access for four of 168 goal-matched exact attacks. The full pre-deployment rule rejects all 171 exact deltas and routes five unresolved cases to review. These findings support treating IAM copilots as untrusted proposal generators whose outputs require independent authorization checks before deployment.

Keywords: Retrieval-Augmented Generation, Prompt Injection, Identity and Access Management, Access Control, Large Language Models, Cloud Security

1. Introduction

Large language models (LLMs) are increasingly being explored for generating and repairing access-control and network policies from natural-language requirements [1–4]. In this setting, the model does more than provide advice. It produces declarative authorization code that may later determine which cloud requests are allowed. A policy can be valid JSON, pass provider checks, and still grant permissions that the task did not authorize.

Retrieval-augmented generation (RAG) adds a second source of risk. AWS Identity and Access Management (IAM) policy generation often depends on deployment-specific facts such as Amazon Resource Names (ARNs), tenant identifiers, approved roles, and operational constraints. A RAG copilot retrieves tickets, runbooks, migration notes, internal wikis, or prior templates and places them beside the trusted task [5]. These documents may be relevant without being authoritative. They may

be stale, copied from another environment, written without approval authority, or deliberately poisoned.

AWS combines identity-based and resource-based policies, including role trust policies, with conditions, explicit denies, permissions boundaries, and role delegation. AWS also provides interfaces for policy validation and concrete request simulation [6, 7]. These interfaces let us separate policy-form validity from authorization behavior. We use AWS as a semantically diverse testbed; we do not assume that the measured rates transfer directly to other clouds or authorization systems.

Consider benchmark case dynamodb_abac_001. The trusted task allows the requested DynamoDB operations only when dynamodb:LeadingKeys identifies tenant#alpha. The poison recommends removing that tenant-isolation condition [8]. The resulting policy may still allow the intended request for tenant#alpha while newly allowing a forbidden request for tenant#beta. We count an attack only when the clean policy rejects the forbidden request and the treatment policy allows it while preserving the intended request.

Indirect prompt injection and RAG poisoning already show that attacker-controlled external content can influence an LLM-integrated system [9–13]. We do not claim a new poisoning primitive. Instead, we address the evaluation problem that

*Corresponding author Email addresses: H.Kaplan_1@tilburguniversity.edu (Hasan Kaplan Ⓡ), i.p.k.weerasinghadewage@tilburguniversity.edu (Indika Kumara Ⓡ), w.j.a.m.vdnHeuvel@tilburguniversity.edu (Willem-Jan van den Heuvel Ⓡ), d.a.tamburri@tue.nl (Damian Andrew Tamburri Ⓡ)

Figure

Figure 1: Illustrative paired authorization-based evaluation of RAG knowledge-base poisoning. An exact delta preserves the intended request and newly authorizes a forbidden request; it counts as an attack only when goal-matched.

arises when the generated artifact is authorization code. Textual difference is not enough: structurally different policies can authorize the same requests, while a provider-valid policy can still exceed the trusted task [14].

We therefore compare a clean execution with a matched treatment execution. We hold the trusted task, model endpoint, decoding configuration, and evaluation procedure fixed. The clean proposal must pass AWS policy-form validation and satisfy the task-specific authorization envelope. The treatment proposal must also pass policy-form validation but violate that envelope in a way that matches the predeclared attacker goal. Both proposals must allow the intended request, while only the treatment proposal may allow the forbidden request. This requirement preserves task utility while testing the attacker objective, following the separation used in agent-security benchmarks [15, 16]. Figure 1 summarizes this paired authorization-based evaluation.

We construct a 60-case benchmark with independently specified authorization envelopes, attacker goals, required policy types, and case-specific validation specifications. Where request-level confirmation is supported, the benchmark also fixes concrete intended and forbidden probes. We evaluate five model endpoints under direct included-context exposure and end-to-end RAG, together with poison-strength, retriever-sensitivity, and authority-spoofing analyses.

Included-context exposure produces 49/292 exact authorization deltas (16.78%), of which 46 are goal-matched exact attacks (46/292; 15.75%). End-to-end BM25 retrieves the designated poison for all 60 tasks but produces only 7/294 goal-matched exact attacks (2.38%). Authority spoofing produces 74/116 goal-matched exact attacks (63.79%) in the frozen two-

endpoint stress test and 115/294 goal-matched exact attacks (39.12%) in the post hoc all-five extension using the same frozen inputs.

In a pre-deployment replay over 194 provider-valid treatment policies that violate their task requirements, AWS CheckNoNewAccess, a policy-comparison check, reports no new access for four of the 168 goal-matched exact attacks. The full pre-deployment rule enforces the independently specified authorization envelope, rejects all 171 exact authorization deltas, and routes five unresolved request-level cases to review. IAM copilots should therefore operate as proposal generators rather than authorization authorities.

The attack mechanism combines established indirect prompt injection and RAG corpus poisoning. Our contribution is the IAM-specific benchmark and authorization-based evaluation, which separates document retrieval, provider-valid policy generation, authorization-envelope violation, attacker-goal matching, and a concrete newly authorized forbidden request.

References (35)