IAMRAGBENCH: Evaluating Authorization Expansion in LLM-Generated AWS IAM Policies under RAG PoisoningIAMRAGBENCH: Benchmarking Authorization Expansions in LLM-Generated AWS IAM Policies under RAG Poisoning
The authors propose IAMRAGBENCH, evaluating whether LLM-generated AWS IAM policies under RAG poisoning are over-privileged: with direct exposure, 46/292 were goal-matched attacks; end-to-end BM25 only 7/294.
- A RAG copilot generates AWS IAM policies from tasks and operational documents, and attacker-controlled retrieved documents may induce policies that pass AWS validation yet exceed the authorization scope of the trusted task; the authors aim to evaluate whether such authorization expansion actually occurs.
- The authors build a 60-case benchmark, IAMRAGBENCH, fixing each case's trusted task, authorization envelope, attack target, and request-level probes; they compare clean and treatment generations in pairs, and count an attack only if the clean policy is compliant, the treatment passes AWS validation but violates the envelope, it matches the predetermined target, and request-level checks confirm newly granted authorization.
- included-context exposure produced 46/292 goal-matched exact attacks; end-to-end BM25 at k=5 retrieved the designated poison for all 60 tasks, but only 7/294 attacks succeeded; authority-spoofing reached 74/116 on the frozen two-endpoint subset; the full pre-deployment rules rejected all 171 exact deltas.
- The authors note: the results are susceptibility under controlled construction rather than prevalence in production environments; the authority two-endpoint results are a deliberately high-susceptibility stress test; minimal-edit poisoning, multi-turn attacks, and whether human or automated filtering can identify poisoning were not evaluated; the main experiments generate only once per prompt; the KMS case cannot be determined at the request level.
- Threat model
- A benign user provides the trusted task, and an attacker controls a low-trust, task-relevant document (ticket, runbook, etc.) that reaches the model via retrieval or direct included-context exposure; the attacker cannot modify the trusted task, envelope, system prompt, model, retriever configuration, or the generated policy, nor directly edit the policy; the goal is to make the copilot generate a broader IAM policy while preserving the requested functionality.
- Evaluated models
- Claude Sonnet 4.5Mistral SmallAmazon Nova LiteAmazon Nova ProLlama 3 8B Instruct
- Benchmarks
- IAMRAGBENCH
- Metrics
- goal-matched exact ASRexact authorization delta ratetarget exposure (Target@k)candidate policy violations
The paper proposes IAMRAGBENCH, a 60-case benchmark for testing whether RAG poisoning causes LLMs to generate AWS IAM policies that exceed the trusted authorization scope. The authors evaluate five endpoints on Amazon Bedrock—Claude Sonnet 4.5, Mistral Small, Amazon Nova Lite, Nova Pro, and Llama 3 8B—and direct exposure to poisoned context produced 46/292 exact authorization expansions hitting the attacker's target (15.75%); end-to-end BM25 at k=5 retrieved the specified poisoned document for all 60 tasks but produced only 7/294 (2.38%). After framing the same permission weakening as a final security architecture exception, a frozen two-endpoint stress test reached 74/116 (63.79%), and a post-hoc extension across all five endpoints reached 115/294 (39.12%). The authors recommend treating IAM assistance tools as untrusted plan generators that require independent authorization checks before deployment.
Why it was selectedThe paper uses paired authorization evaluations to compare poisoning methods, showing that framing permission weakening as a security architecture exception yields a markedly higher attack success rate than ordinary poisoning.
Related events and news
1 events · 1 news mentions
News that mentions this paper
大模型安全周报:智能体安全边界在签名、授权与上下文
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:智能体的安全边界在签名、授权与上下文三层防线里
2611.03431 用 60 个案例证明攻击者控制的检索上下文能诱导 RAG 写出语法合法却超出授权要求的 AWS IAM 策略。
Paper analysis
What problem does this paper attempt to solve?
Evaluate whether RAG poisoning causes LLM-generated AWS IAM policies to pass AWS validation while exceeding the authorization scope of the trusted task.
Core question: When an LLM uses RAG to generate AWS IAM policies from task and operations documents, can attacker-controlled retrieved documents induce provider-valid policies that exceed the trusted authorization requirements, and how can this authorization expansion be rigorously evaluated.
- Scenario and importance: The authors state that LLMs are being used to generate access control policies from natural language requirements, and the output is declarative authorization code that determines which cloud requests are allowed; a policy can be valid JSON, pass provider checks, and still grant permissions not authorized by the task.
- Shortcomings of existing evaluations: The authors argue that textual differences are insufficient to determine an attack—structurally different policies may authorize the same requests, and provider-valid policies may exceed the trusted task; policy formal validity and authorization behavior need to be separated.
- Core observation: The authors follow the idea of differential permissiveness analysis, comparing paired clean and treatment generations under a fixed task, endpoint, and decoding configuration; an attack is counted only when clean denies and treatment allows a forbidden request while preserving the expected requests.
- Paper proposes: IAMRAGBENCH, a 60-case benchmark covering scope, conditions, explicit denies, trust, permissions boundaries, and role delegation, combining deterministic authorization-envelope scoring with case-level request checks.
- Threat model:
- Goal: Make the copilot generate broader IAM policies while preserving the functionality requested by the user.
- Knowledge: The attacker can know the trusted task and relevant IAM semantics in advance and selects one privilege-expansion target for each task.
- Capability: In each endpoint-case trial, control one low-trust, task-relevant document that reaches the model via retrieval or direct included-context exposure.
- Cannot do: Cannot modify the trusted task, envelope, clean documents, system prompt, model endpoint or weights, decoding and retrieval configuration, scorer, AWS validation interface, or deployment gate, nor directly edit the generated policy; compromising the retriever implementation is out of scope.
- Victim system: A retrieval-backed IAM policy copilot that receives trusted authorization tasks and retrieves operations documents.
What related research exists?
Related work falls into four groups: LLM policy synthesis and validation, indirect prompt injection and artifact attacks, knowledge base poisoning, and prompt injection defenses and deterministic enforcement.
LLM-assisted policy synthesis, repair, and verification
- Mai et al. (2025), Vatsa et al. (2025), CloudFix (2026), KUBETEUS (2025)—use LLMs to generate ABAC policies, synthesize AWS access control policies from request specifications, repair cloud policies, and generate Kubernetes network policies.
- AutoCedar, RAISE, Reparo (all 2026)—combine generation with semantic checks: AutoCedar uses verifier feedback to guide Cedar policy synthesis, RAISE uses symbolic verifier feedback to train a policy generator, and Reparo collects authorization evidence from code repositories, generates policies for Cedar/OpenFGA/Rego, and checks them with executable behavioral tests. The paper notes the difference from Reparo: Reparo's policies and behavioral oracle both come from repository evidence, whereas this paper fixes the trusted envelope and attack targets independently of the untrusted retrieval corpus.
Indirect prompt injection and artifact attacks
- Greshake et al. (2023)—indirect prompt injection: embedding adversarial instructions in external data processed by LLM applications.
- AgentDojo (2024) and WASP (2025)—distinguish benign task utility from attacker goal completion in agent settings; this paper follows this separation.
- PoisonedRAG (2025) and Rag-and-Roll (2024)—distinguish malicious documents being retrieved from downstream impact succeeding; this paper likewise measures target document retrieval, envelope violation, provider validation, goal matching, and request-level authorization delta separately.
- ImportSnare (2025) and Prompt-to-SQL (2025)—adversarial context can induce security-relevant code or query artifacts; this paper applies such artifact attacks to declarative authorization artifacts (IAM policies).
Systematic knowledge base poisoning
- Lin et al. (2026)—systematically study knowledge base poisoning in retrieval-augmented code generation: when the target intent is known, select query-relevant vulnerable examples; when the intent is hidden, use clustering to select representative poisoning examples. The paper notes that their goal is vulnerable code propagation, whereas this paper uses one frozen task-matched operations document per IAM case and evaluates specific authorization changes, without optimizing poisoning selection or minimal edits.
Defenses and deterministic enforcement
- StruQ, Task Shield, FATH, DataFilter, Jatmo, MELON, etc.—prompt injection defenses such as structured input, task alignment checks, authenticated formats, filtering, task-specific fine-tuning, and masked re-execution. The paper cites Jia et al. (2026) and Zhan et al. (2025) to note that robustness measured under fixed attacks may not hold under adaptive evaluation, so prompt hardening and retrieval filtering are treated only as exposure-reduction layers.
- CaMeL, Progent, Conseca—the common principle is that secure execution should not rely solely on LLM compliance; this paper applies this principle to declarative authorization artifacts: policies must satisfy an independently specified authorization envelope at the pre-deployment boundary.
Baselines and benchmarks: This is a benchmark paper with no comparison method baselines; in the pre-deployment gate evaluation, three deterministic rules—Provider-valid only, CheckNoNewAccess only, and Authorization envelope only—serve as enforcement baselines and are compared with the full pre-deployment rule (Table 3). Authors' positioning: they do not claim a new poisoning primitive; the contribution is an IAM-specific benchmark and an authorization-based evaluation method.
How does the paper address this problem?
paired generation on a 60-case benchmark with fixed trusted specifications, with attacks adjudicated in stages via envelope scoring, AWS validation, deterministic target matching, and request-level checks.
Overall approach: move attack adjudication from the text level to the authorization-behavior level. IAMRAGBENCH independently fixes the trusted task, required policy type, authorization envelope, attack target, and validation specification for each case, compares clean and treatment generations in pairs, and adjudicates in stages.
Problem formalization and attack definition
- For a task q, a request is written as x = ⟨s, a, r, c⟩ (subject, action, resource, request context), and the authorization behavior of policy P is evaluated under the fixed task-surrounding state Γq, rather than the JSON structure.
- Envelope satisfaction is defined as
Sat(P, E_i) \equiv (\bigwedge_{r \in R_i} r(P)) \wedge (\bigwedge_{f \in F_i} \neg f(P)): a policy that lacks a required permission or guardrail, or implements a forbidden expansion, violates the envelope even if it still authorizes the requested operation. - The main metric is ASR(r)exact: the number of goal-matched exact attacks divided by the number of CleanPass-qualified clean controls, computed separately per regime and never mixing ordinary and authority-spoofing trials.
Paired attack regimes
- included-context: the control prompt contains the trusted task and clean documents; the treatment contains the same task, the same clean documents, plus a task-matched ordinary poison, with clean documents always before the poison; this bypasses retrieval and measures the generator's susceptibility when the poison is visible.
- End-to-end RAG: the clean corpus has 660 documents (60 clean + 600 distractor documents), and the poisoned corpus adds 60 ordinary poisons for 720 documents total; exposure counts only if the designated poison for the current task enters the top-k, and retrieving poisons for other tasks does not count.
- authority-spoofing: the poison keeps the same authorization-weakening target but is presented in the tone of a final security-architecture exception, claims priority, and instructs the model not to restore the omitted restrictions; the control is executed unchanged.
Staged adjudication procedure
- CleanPass: the clean policy enters the denominator only if it passes AWS ValidatePolicy (no ERROR) and satisfies the envelope.
- Candidate policy violation: CleanPass holds and the treatment is provider-valid but violates the envelope; this is only an intermediate classification and does not count as an attack.
- Target matching: envelope failures are deterministically mapped to violation categories and intersected with the category set of the pre-declared attack target gq; no LLM judge is used.
- exact authorization delta: for cases supporting request-level confirmation, pre-declared expected/forbidden probes (Xok, Xbad) verify that both policies allow the expected request and only the treatment allows the forbidden request; identity policies use SimulateCustomPolicy, and trust/resource forms use deterministic task-specific checks; cases such as KMS where a clean baseline cannot be established are recorded as unresolved and do not enter exact ASR.
Benchmark construction and corpus
- The 60 cases form ten report families: 7 action-widening, 7 resource-widening, 9 general condition-weakening, 7 ABAC conditions, 7 explicit-Deny guardrails, 7 public/principal exposure, 7 OIDC trust, 7 iam:PassRole, 1 permissions-boundary, and 1 NotResource; they are organized by authorization effect rather than AWS service.
- Each case contains a clean document (restating the trusted requirements) and an ordinary poison (recommending the pre-declared weakening); the 600 distractor documents reuse service names and IAM vocabulary but do not encode the full envelope, creating topical retrieval competition; all documents are frozen and SHA-256 hashed before generation.
- Generation configuration: temperature 0, top_p unspecified, response limit 1200 tokens, one generation per prompt, no best-of-n; the system prompt requires outputting only a single IAM policy JSON.
Pre-deployment gate
- Four deterministic rules are replayed on the frozen proposal pairs: Provider-valid only, CheckNoNewAccess only, Authorization envelope only, and the full pre-deployment rules (envelope enforcement plus request-level unresolved cases routed to human review); CheckNoNewAccess serves only as auxiliary evidence, not as a final determination.
What experiments did the paper conduct?
Five endpoints were evaluated in paired fashion under three regimes: direct exposure 46/292 attacks, end-to-end 7/294, authority-spoofing two endpoints 74/116.
Experimental setup
- Models tested: Claude Sonnet 4.5, Mistral Small, Amazon Nova Lite, Amazon Nova Pro, Llama 3 8B Instruct, all called via the Amazon Bedrock Converse API (us-east-1); dense retrieval uses Amazon Titan Text Embeddings V2.
- Benchmark: IAMRAGBENCH, 60 cases; clean corpus 660 documents, poisoned corpus 720 documents.
- Retrieval: BM25 (k=5, k1=1.5, b=0.75, no stemming or stopword removal) is the headline retriever; the sensitivity analysis compares dense cosine and hybrid (equal-weight average after min-max normalization).
- Metrics: goal-matched exact ASR (denominator is CleanPass-qualified controls), exact-delta rate, target exposure Target@k, and number of candidate policy violations; no LLM judge, with target matching and envelope scoring both deterministic rules.
- Generation: temperature 0, one generation per prompt; exact counts and rates are reported, with no statistical inference and no confidence intervals.
- Repeatability: a repeatability diagnostic of 12 cases × 2 endpoints × 2 regimes × 3 repetitions = 144 generations.
Main results
According to Table 2 (goal-matched exact attacks / qualified clean controls):
Swipe horizontally to read the table
Endpoint Included-context End-to-end BM25 k=5 Authority spoofing (five-endpoint extension) Claude Sonnet 4.5 0/59 (0.00%) 0/60 (0.00%) 0/60 (0.00%) Mistral Small 4/60 (6.67%) 0/59 (0.00%) 15/59 (25.42%) Nova Lite 6/60 (10.00%) 1/59 (1.69%) 26/59 (44.07%) Nova Pro 20/60 (33.33%) 2/60 (3.33%) 45/60 (75.00%) Llama 3 8B 16/53 (30.19%) 4/56 (7.14%) 29/56 (51.79%) Total 46/292 (15.75%) 7/294 (2.38%) 115/294 (39.12%) - The authors state that the 49 exact deltas under included-context comprise 31 identity-policy request differences, 16 OIDC claim differences, and 2 aws:SourceArn service principal differences; 3 of the OIDC deltas are off-target (Mistral Small, where the witness confirmed audience widening while the target was subject widening).
- The authors interpret the drop in end-to-end ordinary poisoning from direct exposure to 7/294 as a pipeline-level effect rather than a causal estimate of retrieval competition, because end-to-end simultaneously changes document ordering, context composition, and surrounding evidence; BM25 at k=5 retrieved the designated poison for all 60 tasks.
- The authors emphasize that the 0 count for Claude Sonnet 4.5 is a zero observed count under the tested inputs, not evidence of immunity to document poisoning.
Authority spoofing
- What was tested: the same authorization weakening framed as a final security-architecture exception; first a frozen two-endpoint stress test on Nova Pro and Llama 3 8B, which had the highest ordinary end-to-end exact attack counts, then a post-hoc extension to the remaining three endpoints using the same frozen inputs.
- Results: the two-endpoint subset had 74/116 (63.79%) goal-matched exact attacks; the same two-endpoint subset under ordinary poisoning was 6/116. The five-endpoint extension totaled 115/294 (39.12%). The single-poison stratum whose top five contained only the current task's authority document was 38/61 (62.30%).
- Authors' interpretation: the task, clean control, retriever, and validation pipeline are unchanged, and the main treatment difference is the document's claimed security-architecture authority, priority, and do-not-restore framing; the authors state that the experiments cannot identify the model-internal mechanism causing the difference, and that the two-endpoint results are a deliberate high-susceptibility stress test, not a representative endpoint sample.
Poisoning strength and retriever sensitivity
- Poisoning strength (Nova Pro with a fixed clean baseline, Table D.5): a relevant but non-adversarial reference document and a short compatibility note both yielded 0/60 exact deltas; an operational template containing concrete insecure implementation guidance produced 3 candidates and 2/60 (3.33%) exact deltas. The authors state this is consistent with "retrieved actionable implementation guidance affecting authorization outcomes," but the document-level treatment cannot isolate a single wording feature.
- Retriever sensitivity (Nova Lite, Nova Pro, Llama 3 8B, Table D.5): BM25 exposed 60/60 and 7/175 (4.00%) exact deltas; dense exposed 55/60 and 1/167 (0.60%); hybrid exposed 60/60 and 7/178 (3.93%). The authors state these comparisons are descriptive and cannot prove that a retriever is inherently safer, because each method changes the full retrieval context.
Pre-deployment gate replay
- What was tested: four deterministic rules replayed on 880 clean controls and 194 provider-valid candidate violations (including 171 exact deltas, of which 168 were goal-matched) (Table 3).
- Results: Provider-valid only allowed 168/168 goal-matched attacks; CheckNoNewAccess only allowed 4/168 (2.38%); Authorization envelope only and the full pre-deployment rules both allowed 0/168, and the full rules rejected all 171 exact deltas and routed 5 unresolved KMS cases to review.
- Authors' interpretation: provider form validation and policy comparison alone are each insufficient to enforce the trusted task specification; 880/880 clean accepted is only an enforcement soundness check under benchmark-consistent envelopes, not a production false-positive rate estimate.
Other ablations and analyses
- BM25 depth: designated poison exposure rose from 35/60 at k=1 to 60/60 at k=10, and exact-delta counts were non-monotonic.
- Document overlap: no clean-poison document pair had token Jaccard ≥ 0.80, and only one pair had TF-IDF cosine ≥ 0.90; the authors state this hardly shows that exposure is explained by near-duplicate documents.
- Guarded prompting: not consistently beneficial across endpoints and poisoning styles, and made one evaluated Llama condition worse (the paper gives no specific numbers).
- Eight-case construction extension (4 NotAction, 2 permissions-boundary, 1 managed-policy attachment, 1 policy rollback): neither Nova Lite nor Nova Pro had any counted attacks.
- Repeatability diagnostic: all 144 generations were valid JSON; all 48 envelope classifications and all 48 request-level classifications were stable; 34 exact deltas were confirmed among 88 provider-valid clean paired views (ordinary BM25 8/44, authority spoofing 26/44), serving only as a stability diagnostic.
- Negative results: 5 KMS candidates were unresolved because a clean encryption-context baseline could not be established, and do not enter exact ASR; of the 3 candidates for which CheckNoNewAccess reported no new access, 1 explicit-Deny removal was confirmed by an ambient-Allow witness, and 2 OIDC candidates failed the claim-difference witness.
What are some points that can be further explored?
The authors list limitations including the envelope workflow, attacker scope, and generalizability; the experiments cover five general-purpose endpoints, 60 cases, and multiple regimes.
Limitations and future directions noted by the authors
- Generalizability (Section 7.3): AWS IAM is the empirical setting; the authors do not assume the measured rates transfer directly to other cloud or authorization systems; extending to Azure RBAC, Google Cloud IAM, Kubernetes RBAC, Cedar, OPA/Rego, and XACML requires platform-specific envelopes and validation procedures.
- Controlled benchmark and corpus (Section 7.3): the synthetic design does not replicate all properties of enterprise corpora (duplicate, stale, or conflicting templates, document history, heterogeneous access control, provenance-aware ranking); the results measure susceptibility under controlled constructions rather than production prevalence.
- Attacker and model scope (Section 7.3): no optimization of documents against a single model's outputs, no coordinated multi-document attacks, no compromise of the retriever, no multi-turn attacks; minimal-edit poisoning was not evaluated, nor whether human reviewers or automated filters can identify poisoned documents; an IAM-specialized fine-tuned model would require separate training data and contamination control.
- Endpoint coverage (Section 7.3): the frozen two-endpoint authority results are a deliberate high-susceptibility stress test; the post-hoc five-endpoint extension broadens but does not make endpoint coverage representative.
- Repeatability (Section 7.3): the main experiments use one generation per prompt; the 12-case repeatability diagnostic supports only the classification stability of that sampled subset, and cannot establish run-to-run stability for the entire benchmark and all five endpoints.
- Envelope and workflow scope (Section 7.3): the pre-deployment results assume the envelope is correctly specified, authenticated, and maintained independently of untrusted retrieval paths; specification errors were not measured, nor was how organizations derive, approve, and version envelopes, nor false acceptance/false rejection by the gate when the envelope is incomplete or stale; automated remediation, policy minimization, iterative regeneration, gate latency, provider API cost, deployment integration, or human review outcomes were not evaluated.
Experimental coverage
- The models tested are Claude Sonnet 4.5, Mistral Small, Amazon Nova Lite, Amazon Nova Pro, and Llama 3 8B Instruct, 5 in total, all general-purpose black-box hosted endpoints (Section 5.1).
- The benchmark is 60 synthetic cases in ten report families; the clean corpus has 660 documents and the poisoned corpus 720 documents (Sections 4.1, 4.2).
- Regimes cover included-context, end-to-end BM25 RAG, poisoning strength (3 variants), retriever sensitivity (BM25/dense/hybrid, 3 endpoints), and authority spoofing (a 2-endpoint stress test plus a 5-endpoint post-hoc extension) (Section 5.2).
- One generation per prompt, no best-of-n; the repeatability diagnostic is 12 cases × 2 endpoints × 3 repetitions (Sections 5.1, 5.5).
- No LLM judge at any stage: envelope scoring and target matching are deterministic rules, and request-level checks use AWS SimulateCustomPolicy and task-specific checks; 5 KMS cases could not be adjudicated at the request level (Sections 5.4, 6).
Summarize the main content of the paper
Paired evaluation of RAG poisoning on a 60-case AWS IAM benchmark: retrieval of poisoned content does not equal authorization failure; the document authority framework greatly increases the attack rate; a pre-deployment envelope check can block all exact deltas.
A benchmark paper: it evaluates whether LLM-generated AWS IAM policies under RAG poisoning pass provider validation while exceeding the authorization scope of the trusted task.
- Problem: IAM copilots generate authorization code from tasks and operational documents, and attacker-controlled low-trust documents may induce over-privileged policies; neither textual differences nor provider validation suffice to determine real authorization expansion.
- Method: IAMRAGBENCH fixes each case's trusted task, authorization envelope, attack target, and request-level probes, and compares clean and treatment generations in pairs; an attack counts as a goal-matched exact attack only if the clean policy is compliant, the treatment is provider-valid but violates the envelope, it matches the pre-declared target, and request-level checks confirm newly granted forbidden requests.
- Direct exposure: under included-context, the five endpoints total 46/292 (15.75%) goal-matched exact attacks, with Nova Pro highest (20/60) and Claude Sonnet 4.5 at 0/59 (Table 2).
- End-to-end RAG: BM25 at k=5 retrieved the designated poison for all 60 tasks, but only 7/294 (2.38%) attacks succeeded; the authors state that retrieving the poison does not equal authorization compromise.
- Authority spoofing: after framing the same weakening as a final security-architecture exception, the frozen two-endpoint subset (Nova Pro, Llama 3 8B) rose from 6/116 under ordinary poisoning to 74/116 (63.79%), and the post-hoc five-endpoint extension was 115/294 (39.12%).
- Pre-deployment gate: CheckNoNewAccess reported no new access for 4 of the 168 goal-matched exact attacks; the full pre-deployment rules enforcing an independent envelope rejected all 171 exact deltas and routed 5 unresolved KMS cases to review (Table 3).
- Authors' conclusion: IAM copilots should run as untrusted proposal generators, and their outputs must be checked before deployment against an authenticated envelope maintained independently of untrusted retrieval paths; the authors also state that the results are susceptibility under controlled constructions, not production prevalence or a model ranking.