Bedrock LLMjacking, Part 2: Prevention and Governance for AWS Partners
by Guilherme Ramalho and Carlos Felicio - Series · Bedrock LLMjacking Playbook for AWS Partners
Series: Bedrock LLMjacking, Part 1: Incident Response for AWS Partners (1 article)
- 1Bedrock LLMjacking, Part 2: Prevention and Governance for AWS Partners This article


Figure 1. Continuous monitoring: GuardDuty, CloudTrail alarms, and cost anomaly alerts.B1 · Continuous monitoring (proactive detection)
a) GuardDuty: foundational and AI Protection (both)

Step 1: GuardDuty foundational, organization-wide, in every Region
# Management account: delegate a security admin (repeat per Region)aws guardduty enable-organization-admin-account \ --admin-account-id [security-account-id] --region [region]
# Delegated admin: find the detector and auto-enable ALL member accountsDETECTOR=$(aws guardduty list-detectors --query 'DetectorIds[0]' \ --output text --region [region])aws guardduty update-organization-configuration \ --detector-id "$DETECTOR" \ --auto-enable-organization-members ALL --region [region]
Step 2: enable AI Protection, which is what actually detects Bedrock abuse
# Standalone or delegated admin accountaws guardduty update-detector --detector-id "$DETECTOR" \ --features '[{"Name":"AI_PROTECTION","Status":"ENABLED"}]' --region [region]
# Organization-wide: auto-enable for all current and new accountsaws guardduty update-organization-configuration --detector-id "$DETECTOR" \ --features '[{"Name":"AI_PROTECTION","AutoEnable":"ALL"}]' --region [region]
Console: GuardDuty → Protection plans → AI Protection → enable for all accounts. Repeat in every Region, including idle ones. GuardDuty publishes findings to Amazon EventBridge; add a rule that forwards them to SNS or your incident tooling. See Enable AI Protection for multiple accounts and AI Protection finding types . If you operate customer organizations you don't own, agree with each customer which account is the delegated administrator and who receives the findings.
b) Multi-Region CloudTrail + CloudWatch Logs
aws cloudtrail create-trail --name org-trail \ --s3-bucket-name [log-bucket] \ --is-multi-region-trail --is-organization-trailaws cloudtrail start-logging --name org-trail# Send to CloudWatch Logs (needed for the metric filters below)aws cloudtrail update-trail --name org-trail \ --cloud-watch-logs-log-group-arn [log-group-arn] \ --cloud-watch-logs-role-arn [role-arn]
ℹ️ Calls to
bedrock-runtime ( InvokeModel , Converse , …) are management events , so a standard trail captures them. If the trail uses advanced event selectors, make sure they don't exclude bedrock.amazonaws.com . Inference on the bedrock-mantle endpoint ( CreateInference ) is a data event: add an advanced event selector for it ( eventCategory = Data with the bedrock-mantle resource types) in every account where that endpoint could be used. Data events cost extra. Other Bedrock data events ( AWS::Bedrock::* ) cover agents, knowledge bases, guardrails, and async invocation.
c) Metric filters + alarm + notification
# Bedrock invocations (Invoke + Converse; add mantle once data events are on){ (($.eventSource = "bedrock.amazonaws.com") && (($.eventName = "InvokeModel") || ($.eventName = "InvokeModelWithResponseStream") || ($.eventName = "Converse") || ($.eventName = "ConverseStream"))) || (($.eventSource = "bedrock-mantle.amazonaws.com") && ($.eventName = "CreateInference")) }
# Model subscription through AWS Marketplace{ ($.eventSource = "aws-marketplace.amazonaws.com") && ($.eventName = "Subscribe") }
# Quota increase request{ ($.eventSource = "servicequotas.amazonaws.com") && ($.eventName = "RequestServiceQuotaIncrease") }
# New Bedrock API key (long-term){ ($.eventSource = "iam.amazonaws.com") && ($.eventName = "CreateServiceSpecificCredential") }
# Log tampering{ ($.eventName = "StopLogging") || ($.eventName = "DeleteTrail") || ($.eventName = "DeleteModelInvocationLoggingConfiguration") }aws logs put-metric-filter --log-group-name [cloudtrail-log-group] \ --filter-name BedrockInvocations \ --filter-pattern '{ ($.eventSource = "bedrock.amazonaws.com") && (($.eventName = "InvokeModel") || ($.eventName = "InvokeModelWithResponseStream") || ($.eventName = "Converse") || ($.eventName = "ConverseStream")) }' \ --metric-transformations metricName=BedrockInvocationCount,metricNamespace=Security/Bedrock,metricValue=1
aws cloudwatch put-metric-alarm --alarm-name BedrockInvocationSpike \ --namespace Security/Bedrock --metric-name BedrockInvocationCount \ --statistic Sum --period 300 --threshold [threshold] \ --comparison-operator GreaterThanOrEqualToThreshold \ --evaluation-periods 1 --alarm-actions [sns-topic-arn]

d) Cost signals on the payer: anomaly detection and budgets
# Per-linked-account monitor: one baseline per customer accountaws ce create-anomaly-monitor --region us-east-1 \ --anomaly-monitor '{"MonitorName":"LinkedAccountMonitor","MonitorType":"DIMENSIONAL","MonitorDimension":"LINKED_ACCOUNT"}'
aws ce create-anomaly-subscription --region us-east-1 \ --anomaly-subscription '{"SubscriptionName":"ImmediateAlerts","Frequency":"IMMEDIATE", "MonitorArnList":["[monitor-arn]"], "Subscribers":[{"Type":"SNS","Address":"[sns-topic-arn]"}], "ThresholdExpression":{"Dimensions":{"Key":"ANOMALY_TOTAL_IMPACT_ABSOLUTE", "Values":["100"],"MatchOptions":["GREATER_THAN_OR_EQUAL"]}}}'
A
SERVICE monitor catches organization-wide spikes; a LINKED_ACCOUNT monitor (or a custom monitor per group of customer accounts) catches a spike in one customer that the total would hide. Immediate alerts require an SNS subscriber ; email works only for daily or weekly digests. The topic needs a policy that lets Cost Anomaly Detection publish ( how to ). Route the alerts to the partner's SOC.AWS Budgets: add a Bedrock-specific budget per account. Where the customer authorizes it, a budget action can attach
deny-bedrock-v2.json (created as a customer managed policy) to the identities you select when the threshold is crossed; it doesn't cover identities created later, so it complements an SCP rather than replacing it. Remember that cost data lags up to a day: these are safety nets, not a replacement for CloudTrail alarms.e) Model invocation logging
Model invocation logging records prompts and responses, but only if it's enabled beforehand. Turn it on wherever there are legitimate GenAI workloads, and alarm on
DeleteModelInvocationLoggingConfiguration . In accounts without Bedrock the attacker won't turn it on, so the response depends on CloudTrail (the fact of invocation, not the content).f) Account contacts
AWS abuse notices go to the account's contacts. Make the SECURITY alternate contact a monitored mailbox in every account, decide per partner model who owns it, and review it at onboarding (Part 1, A5):
aws account put-alternate-contact --account-id [account-id] \ --alternate-contact-type SECURITY --name "[SOC name]" \ --email-address [soc-mailbox] --phone-number "[phone]" --title "Security"
B2 · Quota increases: anticipate, detect, validate
Attackers request quota increases to raise invocations per minute (event
RequestServiceQuotaIncrease , source servicequotas.amazonaws.com ).
Action | How |
|---|---|
Anticipate | An SCP restricting servicequotas:RequestServiceQuotaIncrease in accounts that shouldn't scale themselves; quota management centralized with the partner (B3.1). |
Detect | Metric filter + alarm on the event (B1-c). Alert on any Bedrock quota request. |
Validate | (1) Does the principal usually manage quotas? (2) Is there an approved ticket or change? (3) Is a legitimate workload growing? (4) Did it come from an expected IP and role? (5) Does it coincide with an invocation spike? A spike plus a quota request is a strong sign of abuse. |

Figure 2. An organization-wide baseline: SCPs, a delegated security account, and least-privilege workload accounts.
B3 · Prevention and hardening
B3.1 Service control policies (SCPs)
Central control of the organization's maximum permissions, combined with least privilege. SCPs are only an option for whoever controls the management account; MSSPs and consultants use identity-based policies instead (B3.2). The file
scp-bedrock-guardrails-v2.json holds the guardrails tied to this playbook's vectors.
a) Deny third-party model subscriptions outside the allowlist, using the
aws-marketplace:ProductId condition key:
{ "Sid": "DenyMarketplaceSubscribeExceptApproved", "Effect": "Deny", "Action": "aws-marketplace:Subscribe", "Resource": "*", "Condition": { "StringNotEquals": { "aws-marketplace:ProductId": ["[approved-product-id-1]", "[approved-product-id-2]"] } }}

b) Restrict quota increase requests (closes the B2 vector):
{ "Sid": "DenySelfServiceQuotaIncrease", "Effect": "Deny", "Action": "servicequotas:RequestServiceQuotaIncrease", "Resource": "*"}
This blocks all self-service quota requests, not only Bedrock ones. Apply it where quota management is centralized and leave an exception OU or role for legitimate scaling.
c) Control Bedrock API keys. Long-term API keys are static secrets that leak like access keys. Block their use and creation; short-term keys, which expire within 12 hours and inherit the caller's session, keep working ( reference ):
{ "Sid": "DenyLongTermBedrockApiKeyUse", "Effect": "Deny", "Action": "bedrock:CallWithBearerToken", "Resource": "*", "Condition": { "StringEquals": { "bedrock:bearerTokenType": "LONG_TERM" } } },{ "Sid": "DenyLongTermBedrockMantleApiKeyUse", "Effect": "Deny", "Action": "bedrock-mantle:CallWithBearerToken", "Resource": "*", "Condition": { "StringEquals": { "bedrock-mantle:bearerTokenType": "LONG_TERM" } } },{ "Sid": "DenyLongTermBedrockApiKeyCreation", "Effect": "Deny", "Action": "iam:CreateServiceSpecificCredential", "Resource": "*", "Condition": { "StringEquals": { "iam:ServiceSpecificCredentialServiceName": "bedrock.amazonaws.com" } } }
If some teams need long-term keys, replace the creation Deny with one that caps the lifetime using
iam:ServiceSpecificCredentialAgeDays .
aws organizations create-policy --type SERVICE_CONTROL_POLICY \ --name BedrockGuardrails --description "Marketplace allowlist + quota control + API key control" \ --content file://scp-bedrock-guardrails-v2.jsonaws organizations attach-policy --policy-id [p-xxxxxxxx] --target-id [ou-or-account-id]
🌍 Region-deny SCPs and cross-Region inference. If you block unused Regions with
aws:RequestedRegion , Geographic profiles need every destination Region, and global.* profiles are evaluated partly with aws:RequestedRegion = unspecified . Either allow unspecified or exempt with bedrock:InferenceProfileArn ; see SCP requirements for Global cross-Region inference . To forbid global routing entirely, deny bedrock:* when aws:RequestedRegion is unspecified and the profile ARN matches global.* .

B3.2 Identity-based Deny policy
The same policy used for containment in Part 1, Step 4 (
deny-bedrock-v2.json ), covering bedrock-runtime , bedrock-mantle , and API keys. To block specific models rather than all inference, replace "*" with model ARNs (see identity-based policy examples ). Test in dev before production.

B3.3 Least privilege, credentials, and pipelines
- Grant
bedrock:InvokeModel*andbedrock-mantle:CreateInferenceonly to the roles that need them, scoped to approved model ARNs.
- No long-term access keys or long-term Bedrock API keys: use IAM roles, IAM Identity Center, and short-lived credentials.
- Keep secrets out of pipeline environment variables; use OIDC federation or a secrets manager. Make sure IaC (for example Terraform) doesn't create long-term keys, or a rotated key comes back on the next apply. This applies to partner pipelines that reach customer accounts as well.
- Require IMDSv2 on EC2 to make instance credential theft harder.
- Run IAM Access Analyzer regularly to find unused and over-broad Bedrock permissions and external trust.
B4 · Partner angles
Topic | Recommendation |
|---|---|
🏢 Multi-account / organization | As the payer, contain and prevent centrally with SCPs at the organization or OU level instead of account-by-account policies. One change reaches every affected account. |
🔑 Your own credentials | Your automation roles, tools, and pipelines reach many customers: protect them as the highest-value target. Short sessions, no long-term keys, ExternalId , and a documented hunt across every managed account (Part 1, A1). |
💳 Billing | Under resale, abuse lands on your bill first. Monitor per linked account (B1-d), tell customers about spikes they may not see, and don't promise refunds (Part 1, A6). |
📧 Contacts | Decide who owns the SECURITY contact in each partner model and check it at onboarding (B1-f). |
📐 Standardization | Apply these guardrails as the baseline for every newly onboarded account, including AI Protection on organization-wide auto-enable. Keep the Part 1 response playbook identical across customers. |
🤝 Delegated access | Agree with each customer, in advance and in writing, which containment actions you may take without waiting for approval, with which IR role (Part 1, A4). |
B5 · Proactive checklist (baseline)
Item | Target state | ✓ |
|---|---|---|
GuardDuty foundational | Organization-wide, auto-enable ALL, every Region | ☐ |
GuardDuty AI Protection | AI_PROTECTION auto-enable ALL, every Region (separate plan, billed separately) | ☐ |
CloudTrail | Multi-Region organization trail → CloudWatch Logs and S3; bedrock-mantle data events where that endpoint is used | ☐ |
Alarms | Invoke/Converse/mantle, Subscribe , RequestServiceQuotaIncrease , CreateServiceSpecificCredential , log tampering → SNS; GuardDuty → EventBridge → SNS | ☐ |
Cost | Cost Anomaly Detection per linked account on the payer, immediate alerts → SNS; Bedrock budgets | ☐ |
SCPs | Marketplace allowlist; model allowlist; centralized quota requests; no long-term Bedrock API keys; Region SCP compatible with cross-Region inference | ☐ |
IAM | Least-privilege Bedrock access; Access Analyzer reviews; no long-term keys; no secrets in pipelines or IaC; IMDSv2 | ☐ |
Logging | Model invocation logging where GenAI workloads are legitimate | ☐ |
Contacts and access | Monitored SECURITY contact in every account; written delegated-access agreement and IR role per customer | ☐ |
🏁 Wrapping up the series
LLMjacking is a credential problem that shows up as a bill. Part 1 gives your SecOps team a repeatable response: agree who may act, find the credential, contain in the right order, escalate early, and talk to the customer. Part 2 gives your governance team the baseline that catches the next attempt in minutes and blocks most of it outright.
👉 Your turn: check today whether GuardDuty AI Protection is enabled in every Region of every organization you manage, and who receives the SECURITY contact emails. Share what you found in the comments.
📚 Learn more
Series: Bedrock LLMjacking, Part 1: Incident Response for AWS Partners (1 article)
- 1Bedrock LLMjacking, Part 2: Prevention and Governance for AWS Partners This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article