[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-aws-setup-security-agent":3,"mdc--a6mclq-key":32,"related-repo-aws-setup-security-agent":2203,"related-org-aws-setup-security-agent":2307},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":21,"repoUrl":22,"updatedAt":23,"license":24,"forks":25,"topics":26,"repo":27,"sourceUrl":30,"mdContent":31},"setup-security-agent","configure AWS Security Agent","Configure AWS Security Agent for the current workspace — provision or reuse an agent space, IAM service role, and S3 bucket. Use when the user asks to \"set up security agent\", \"configure security scanner\", \"is security agent configured\", or on first-time use before any scan or pentest.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"aws","AWS (Amazon)","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Faws.png",[12,16,19],{"name":13,"slug":14,"type":15},"Security","security","tag",{"name":17,"slug":18,"type":15},"Configuration","configuration",{"name":20,"slug":8,"type":15},"AWS",1822,"https:\u002F\u002Fgithub.com\u002Faws\u002Fagent-toolkit-for-aws","2026-07-16T05:59:11.513678",null,157,[],{"repoUrl":22,"stars":21,"forks":25,"topics":28,"description":29},[],"Official, AWS-supported MCP servers, skills, and plugins to help AI agents build on AWS","https:\u002F\u002Fgithub.com\u002Faws\u002Fagent-toolkit-for-aws\u002Ftree\u002FHEAD\u002Fplugins\u002Faws-agents-for-devsecops\u002Fskills\u002Fsetup-security-agent","---\nname: setup-security-agent\ndescription: Configure AWS Security Agent for the current workspace — provision or reuse an agent space, IAM service role, and S3 bucket. Use when the user asks to \"set up security agent\", \"configure security scanner\", \"is security agent configured\", or on first-time use before any scan or pentest.\n---\n\n# AWS Security Agent — Setup\n\nThis skill handles ONE thing: making sure the workspace has a working agent space, IAM service role, and S3 bucket linked together. Scans and pentests live in separate skills and assume this is done.\n\n---\n\n## Local state convention\n\nAll Security Agent skills share workspace-local state at `.security-agent\u002F`:\n\n- `config.json` — `{ \"agent_space_id\": \"as-...\", \"region\": \"us-east-1\", \"code_reviews\": { \"\u003Cabs_path>\": \"cr-...\" } }`. Account ID, role ARN, and bucket name are derived by convention. The `code_reviews` map lets scans reuse the same CodeReview for a workspace.\n- `scans.json` — array of `{ scan_id, code_review_id, job_id, agent_space_id, scan_type, title, started_at, status, path }` (keep last 50)\n- `pentests.json` — same shape, for pentest jobs\n- `.gitignore` — contents `*` so this directory stays untracked\n- `findings-{scan_id}.md` — written by the scan skill after each scan completes\n\nThis skill's job is to populate `config.json` and create `.gitignore`.\n\n### Derived values (convention over config)\n\nOther skills compute these on each invocation rather than reading them from `config.json`:\n\n| Value | Convention |\n|-------|------------|\n| `ACCOUNT` | `aws sts get-caller-identity --query Account --output text` |\n| `REGION` | `config.region` (default `us-east-1`) |\n| `service_role_arn` | `arn:aws:iam::${ACCOUNT}:role\u002FSecurityAgentScanRole` |\n| `s3_bucket` | `security-agent-scans-${ACCOUNT}-${REGION}` |\n\nWhy minimal config: the role name and bucket name are deterministic, so storing them adds drift risk (a user re-creating a role manually would silently use a stale path). Only `agent_space_id` is stored because users may have multiple agent spaces and we don't want to ask which one every session.\n\n---\n\n## Workflow\n\n1. **Check existing state:** read `.security-agent\u002Fconfig.json` if it exists.\n2. **Caller identity + region:**\n\n   ```bash\n   export ACCOUNT=$(aws sts get-caller-identity --query Account --output text)\n   export REGION=\"${AWS_REGION:-us-east-1}\"\n   ```\n\n3. **Agent space:**\n   - If `config.agent_space_id` is set, verify with:\n\n     ```bash\n     aws securityagent batch-get-agent-spaces --agent-space-ids \u003Cid>\n     ```\n\n     If the response shows it doesn't exist, treat as missing.\n   - If missing, list existing:\n\n     ```bash\n     aws securityagent list-agent-spaces\n     ```\n\n     - If any exist → **show them to the user** with name + id and ask: \"Would you like to reuse one of these, or should I create a new one?\" Wait for the answer. **Do not auto-select.**\n     - If user picks one, use that `agentSpaceId`.\n     - If user wants new, or none exist:\n\n       ```bash\n       aws securityagent create-agent-space --name security-scans\n       ```\n\n       Capture returned `agentSpaceId`.\n4. **Service role** (`SecurityAgentScanRole`, ARN `arn:aws:iam::$ACCOUNT:role\u002FSecurityAgentScanRole`):\n   - Probe:\n\n     ```bash\n     aws iam get-role --role-name SecurityAgentScanRole\n     ```\n\n   - If `NoSuchEntity` is returned, create the role. **Idempotency note:** `create-role` will fail with `EntityAlreadyExists` if the role already exists. If that happens, fall through to `update-assume-role-policy` to ensure the trust policy is correct.\n\n     ```bash\n     # Trust policy — includes aws:SourceAccount confused-deputy guard\n     cat > \u002Ftmp\u002Fsa-trust.json \u003C\u003CEOF\n     {\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"securityagent.amazonaws.com\"},\"Action\":\"sts:AssumeRole\",\"Condition\":{\"StringEquals\":{\"aws:SourceAccount\":\"${ACCOUNT}\"}}}]}\n     EOF\n     # Permissions policy (S3 + CloudWatch Logs)\n     cat > \u002Ftmp\u002Fsa-perms.json \u003C\u003CEOF\n     {\"Version\":\"2012-10-17\",\"Statement\":[\n       {\"Effect\":\"Allow\",\"Action\":[\"s3:GetObject\",\"s3:GetObjectVersion\",\"s3:ListBucket\"],\"Resource\":[\"arn:aws:s3:::security-agent-scans-${ACCOUNT}-${REGION}\",\"arn:aws:s3:::security-agent-scans-${ACCOUNT}-${REGION}\u002F*\"]},\n       {\"Effect\":\"Allow\",\"Action\":[\"logs:CreateLogGroup\",\"logs:CreateLogStream\",\"logs:PutLogEvents\"],\"Resource\":\"arn:aws:logs:*:${ACCOUNT}:log-group:\u002Faws\u002Fsecurityagent\u002F*\"}\n     ]}\n     EOF\n\n     aws iam create-role --role-name SecurityAgentScanRole --assume-role-policy-document file:\u002F\u002F\u002Ftmp\u002Fsa-trust.json\n     # if EntityAlreadyExists:\n     aws iam update-assume-role-policy --role-name SecurityAgentScanRole --policy-document file:\u002F\u002F\u002Ftmp\u002Fsa-trust.json\n     # always (re)apply permissions:\n     aws iam put-role-policy --role-name SecurityAgentScanRole --policy-name SecurityAgentCodeReviewAccess --policy-document file:\u002F\u002F\u002Ftmp\u002Fsa-perms.json\n     ```\n\n5. **S3 bucket** (`security-agent-scans-$ACCOUNT-$REGION`):\n   - Probe:\n\n     ```bash\n     BUCKET=\"security-agent-scans-${ACCOUNT}-${REGION}\"\n     aws s3api head-bucket --bucket \"$BUCKET\"\n     ```\n\n   - If 404, create:\n\n     ```bash\n     # us-east-1: no LocationConstraint\n     aws s3api create-bucket --bucket \"$BUCKET\"\n     # other regions:\n     aws s3api create-bucket --bucket \"$BUCKET\" --create-bucket-configuration LocationConstraint=\"$REGION\"\n     ```\n\n   - Always (re)apply public access block + 30-day lifecycle:\n\n     ```bash\n     aws s3api put-public-access-block --bucket \"$BUCKET\" \\\n       --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true\n\n     cat > \u002Ftmp\u002Fsa-lifecycle.json \u003C\u003C'EOF'\n     {\"Rules\":[{\"ID\":\"AutoDeleteUploads\",\"Status\":\"Enabled\",\"Filter\":{\"Prefix\":\"\"},\"Expiration\":{\"Days\":30}}]}\n     EOF\n     aws s3api put-bucket-lifecycle-configuration --bucket \"$BUCKET\" --lifecycle-configuration file:\u002F\u002F\u002Ftmp\u002Fsa-lifecycle.json\n     ```\n\n6. **Register role + bucket on the agent space (idempotent):**\n   - Read existing resources:\n\n     ```bash\n     aws securityagent batch-get-agent-spaces --agent-space-ids \u003Cid>\n     ```\n\n     Look at `agentSpaces[0].awsResources.iamRoles` and `awsResources.s3Buckets`.\n   - If the role ARN or the bucket name is missing from those lists, merge and update:\n\n     ```bash\n     aws securityagent update-agent-space --agent-space-id \u003Cid> --name \u003Cexisting-name> \\\n       --aws-resources iamRoles=[\u003Carn1>,\u003Carn2>...],s3Buckets=[\u003Cbucket1>,\u003Cbucket2>...]\n     ```\n\n7. **Persist** to `.security-agent\u002Fconfig.json` (minimal — account\u002Frole\u002Fbucket are derived):\n\n   ```json\n   {\n     \"agent_space_id\": \"as-xxxxx\",\n     \"region\": \"us-east-1\"\n   }\n   ```\n\n8. **Create gitignore** if missing:\n\n   ```bash\n   mkdir -p .security-agent\n   echo '*' > .security-agent\u002F.gitignore\n   ```\n\n9. Confirm to user: \"Setup complete. You can run security scans or pentests now.\"\n\n---\n\n## Rules\n\n- Never auto-select an agent space when multiple exist — always ask the user\n- Never disable safety protections (the public-access-block stays on)\n- Trust policy must allow `securityagent.amazonaws.com` (production service principal) and include the `aws:SourceAccount` confused-deputy guard\n- If the user provides their own role name or bucket name (different from the conventional defaults), tell them: this plugin uses convention-based defaults (`SecurityAgentScanRole` \u002F `security-agent-scans-${ACCOUNT}-${REGION}`). Either accept those defaults or extend the skill — the other skills derive these names rather than reading them from config.\n- The scan and pentest skills can call this skill inline if `config.json` is missing — first-time users don't need to run setup separately.\n\n---\n\n## Troubleshooting\n\n- **`AccessDenied` calling `iam:CreateRole`** → user lacks IAM permissions. Ask them to run setup with their own role ARN, or to grant `iam:CreateRole` + `iam:PutRolePolicy`.\n- **`AccessDenied` on `s3api create-bucket`** → either the bucket name is taken globally, or the user lacks `s3:CreateBucket`. Suggest using an existing bucket they own and pass it explicitly.\n- **Role exists but trust policy is wrong** → `update-assume-role-policy` (step 4 fallback). If they don't want that role updated, ask them for a different role ARN.\n- **Agent space exists but in a different region** → tell the user; suggest using the right region or creating a new space in the current region.\n",{"data":33,"body":34},{"name":4,"description":6},{"type":35,"children":36},"root",[37,46,52,56,63,77,169,188,195,206,328,341,344,350,2019,2022,2028,2093,2096,2102,2197],{"type":38,"tag":39,"props":40,"children":42},"element","h1",{"id":41},"aws-security-agent-setup",[43],{"type":44,"value":45},"text","AWS Security Agent — Setup",{"type":38,"tag":47,"props":48,"children":49},"p",{},[50],{"type":44,"value":51},"This skill handles ONE thing: making sure the workspace has a working agent space, IAM service role, and S3 bucket linked together. Scans and pentests live in separate skills and assume this is done.",{"type":38,"tag":53,"props":54,"children":55},"hr",{},[],{"type":38,"tag":57,"props":58,"children":60},"h2",{"id":59},"local-state-convention",[61],{"type":44,"value":62},"Local state convention",{"type":38,"tag":47,"props":64,"children":65},{},[66,68,75],{"type":44,"value":67},"All Security Agent skills share workspace-local state at ",{"type":38,"tag":69,"props":70,"children":72},"code",{"className":71},[],[73],{"type":44,"value":74},".security-agent\u002F",{"type":44,"value":76},":",{"type":38,"tag":78,"props":79,"children":80},"ul",{},[81,109,128,139,158],{"type":38,"tag":82,"props":83,"children":84},"li",{},[85,91,93,99,101,107],{"type":38,"tag":69,"props":86,"children":88},{"className":87},[],[89],{"type":44,"value":90},"config.json",{"type":44,"value":92}," — ",{"type":38,"tag":69,"props":94,"children":96},{"className":95},[],[97],{"type":44,"value":98},"{ \"agent_space_id\": \"as-...\", \"region\": \"us-east-1\", \"code_reviews\": { \"\u003Cabs_path>\": \"cr-...\" } }",{"type":44,"value":100},". Account ID, role ARN, and bucket name are derived by convention. The ",{"type":38,"tag":69,"props":102,"children":104},{"className":103},[],[105],{"type":44,"value":106},"code_reviews",{"type":44,"value":108}," map lets scans reuse the same CodeReview for a workspace.",{"type":38,"tag":82,"props":110,"children":111},{},[112,118,120,126],{"type":38,"tag":69,"props":113,"children":115},{"className":114},[],[116],{"type":44,"value":117},"scans.json",{"type":44,"value":119}," — array of ",{"type":38,"tag":69,"props":121,"children":123},{"className":122},[],[124],{"type":44,"value":125},"{ scan_id, code_review_id, job_id, agent_space_id, scan_type, title, started_at, status, path }",{"type":44,"value":127}," (keep last 50)",{"type":38,"tag":82,"props":129,"children":130},{},[131,137],{"type":38,"tag":69,"props":132,"children":134},{"className":133},[],[135],{"type":44,"value":136},"pentests.json",{"type":44,"value":138}," — same shape, for pentest jobs",{"type":38,"tag":82,"props":140,"children":141},{},[142,148,150,156],{"type":38,"tag":69,"props":143,"children":145},{"className":144},[],[146],{"type":44,"value":147},".gitignore",{"type":44,"value":149}," — contents ",{"type":38,"tag":69,"props":151,"children":153},{"className":152},[],[154],{"type":44,"value":155},"*",{"type":44,"value":157}," so this directory stays untracked",{"type":38,"tag":82,"props":159,"children":160},{},[161,167],{"type":38,"tag":69,"props":162,"children":164},{"className":163},[],[165],{"type":44,"value":166},"findings-{scan_id}.md",{"type":44,"value":168}," — written by the scan skill after each scan completes",{"type":38,"tag":47,"props":170,"children":171},{},[172,174,179,181,186],{"type":44,"value":173},"This skill's job is to populate ",{"type":38,"tag":69,"props":175,"children":177},{"className":176},[],[178],{"type":44,"value":90},{"type":44,"value":180}," and create ",{"type":38,"tag":69,"props":182,"children":184},{"className":183},[],[185],{"type":44,"value":147},{"type":44,"value":187},".",{"type":38,"tag":189,"props":190,"children":192},"h3",{"id":191},"derived-values-convention-over-config",[193],{"type":44,"value":194},"Derived values (convention over config)",{"type":38,"tag":47,"props":196,"children":197},{},[198,200,205],{"type":44,"value":199},"Other skills compute these on each invocation rather than reading them from ",{"type":38,"tag":69,"props":201,"children":203},{"className":202},[],[204],{"type":44,"value":90},{"type":44,"value":76},{"type":38,"tag":207,"props":208,"children":209},"table",{},[210,229],{"type":38,"tag":211,"props":212,"children":213},"thead",{},[214],{"type":38,"tag":215,"props":216,"children":217},"tr",{},[218,224],{"type":38,"tag":219,"props":220,"children":221},"th",{},[222],{"type":44,"value":223},"Value",{"type":38,"tag":219,"props":225,"children":226},{},[227],{"type":44,"value":228},"Convention",{"type":38,"tag":230,"props":231,"children":232},"tbody",{},[233,255,286,307],{"type":38,"tag":215,"props":234,"children":235},{},[236,246],{"type":38,"tag":237,"props":238,"children":239},"td",{},[240],{"type":38,"tag":69,"props":241,"children":243},{"className":242},[],[244],{"type":44,"value":245},"ACCOUNT",{"type":38,"tag":237,"props":247,"children":248},{},[249],{"type":38,"tag":69,"props":250,"children":252},{"className":251},[],[253],{"type":44,"value":254},"aws sts get-caller-identity --query Account --output text",{"type":38,"tag":215,"props":256,"children":257},{},[258,267],{"type":38,"tag":237,"props":259,"children":260},{},[261],{"type":38,"tag":69,"props":262,"children":264},{"className":263},[],[265],{"type":44,"value":266},"REGION",{"type":38,"tag":237,"props":268,"children":269},{},[270,276,278,284],{"type":38,"tag":69,"props":271,"children":273},{"className":272},[],[274],{"type":44,"value":275},"config.region",{"type":44,"value":277}," (default ",{"type":38,"tag":69,"props":279,"children":281},{"className":280},[],[282],{"type":44,"value":283},"us-east-1",{"type":44,"value":285},")",{"type":38,"tag":215,"props":287,"children":288},{},[289,298],{"type":38,"tag":237,"props":290,"children":291},{},[292],{"type":38,"tag":69,"props":293,"children":295},{"className":294},[],[296],{"type":44,"value":297},"service_role_arn",{"type":38,"tag":237,"props":299,"children":300},{},[301],{"type":38,"tag":69,"props":302,"children":304},{"className":303},[],[305],{"type":44,"value":306},"arn:aws:iam::${ACCOUNT}:role\u002FSecurityAgentScanRole",{"type":38,"tag":215,"props":308,"children":309},{},[310,319],{"type":38,"tag":237,"props":311,"children":312},{},[313],{"type":38,"tag":69,"props":314,"children":316},{"className":315},[],[317],{"type":44,"value":318},"s3_bucket",{"type":38,"tag":237,"props":320,"children":321},{},[322],{"type":38,"tag":69,"props":323,"children":325},{"className":324},[],[326],{"type":44,"value":327},"security-agent-scans-${ACCOUNT}-${REGION}",{"type":38,"tag":47,"props":329,"children":330},{},[331,333,339],{"type":44,"value":332},"Why minimal config: the role name and bucket name are deterministic, so storing them adds drift risk (a user re-creating a role manually would silently use a stale path). Only ",{"type":38,"tag":69,"props":334,"children":336},{"className":335},[],[337],{"type":44,"value":338},"agent_space_id",{"type":44,"value":340}," is stored because users may have multiple agent spaces and we don't want to ask which one every session.",{"type":38,"tag":53,"props":342,"children":343},{},[],{"type":38,"tag":57,"props":345,"children":347},{"id":346},"workflow",[348],{"type":44,"value":349},"Workflow",{"type":38,"tag":351,"props":352,"children":353},"ol",{},[354,373,499,687,1182,1597,1835,1947,2014],{"type":38,"tag":82,"props":355,"children":356},{},[357,363,365,371],{"type":38,"tag":358,"props":359,"children":360},"strong",{},[361],{"type":44,"value":362},"Check existing state:",{"type":44,"value":364}," read ",{"type":38,"tag":69,"props":366,"children":368},{"className":367},[],[369],{"type":44,"value":370},".security-agent\u002Fconfig.json",{"type":44,"value":372}," if it exists.",{"type":38,"tag":82,"props":374,"children":375},{},[376,381],{"type":38,"tag":358,"props":377,"children":378},{},[379],{"type":44,"value":380},"Caller identity + region:",{"type":38,"tag":382,"props":383,"children":388},"pre",{"className":384,"code":385,"language":386,"meta":387,"style":387},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export ACCOUNT=$(aws sts get-caller-identity --query Account --output text)\nexport REGION=\"${AWS_REGION:-us-east-1}\"\n","bash","",[389],{"type":38,"tag":69,"props":390,"children":391},{"__ignoreMap":387},[392,457],{"type":38,"tag":393,"props":394,"children":397},"span",{"class":395,"line":396},"line",1,[398,404,410,416,421,427,432,437,442,447,452],{"type":38,"tag":393,"props":399,"children":401},{"style":400},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[402],{"type":44,"value":403},"export",{"type":38,"tag":393,"props":405,"children":407},{"style":406},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[408],{"type":44,"value":409}," ACCOUNT",{"type":38,"tag":393,"props":411,"children":413},{"style":412},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[414],{"type":44,"value":415},"=$(",{"type":38,"tag":393,"props":417,"children":419},{"style":418},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[420],{"type":44,"value":8},{"type":38,"tag":393,"props":422,"children":424},{"style":423},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[425],{"type":44,"value":426}," sts",{"type":38,"tag":393,"props":428,"children":429},{"style":423},[430],{"type":44,"value":431}," get-caller-identity",{"type":38,"tag":393,"props":433,"children":434},{"style":423},[435],{"type":44,"value":436}," --query",{"type":38,"tag":393,"props":438,"children":439},{"style":423},[440],{"type":44,"value":441}," Account",{"type":38,"tag":393,"props":443,"children":444},{"style":423},[445],{"type":44,"value":446}," --output",{"type":38,"tag":393,"props":448,"children":449},{"style":423},[450],{"type":44,"value":451}," text",{"type":38,"tag":393,"props":453,"children":454},{"style":412},[455],{"type":44,"value":456},")\n",{"type":38,"tag":393,"props":458,"children":460},{"class":395,"line":459},2,[461,465,470,475,480,485,490,494],{"type":38,"tag":393,"props":462,"children":463},{"style":400},[464],{"type":44,"value":403},{"type":38,"tag":393,"props":466,"children":467},{"style":406},[468],{"type":44,"value":469}," REGION",{"type":38,"tag":393,"props":471,"children":472},{"style":412},[473],{"type":44,"value":474},"=",{"type":38,"tag":393,"props":476,"children":477},{"style":412},[478],{"type":44,"value":479},"\"${",{"type":38,"tag":393,"props":481,"children":482},{"style":406},[483],{"type":44,"value":484},"AWS_REGION",{"type":38,"tag":393,"props":486,"children":487},{"style":412},[488],{"type":44,"value":489},":-",{"type":38,"tag":393,"props":491,"children":492},{"style":406},[493],{"type":44,"value":283},{"type":38,"tag":393,"props":495,"children":496},{"style":412},[497],{"type":44,"value":498},"}\"\n",{"type":38,"tag":82,"props":500,"children":501},{},[502,507],{"type":38,"tag":358,"props":503,"children":504},{},[505],{"type":44,"value":506},"Agent space:",{"type":38,"tag":78,"props":508,"children":509},{},[510,578],{"type":38,"tag":82,"props":511,"children":512},{},[513,515,521,523,572,576],{"type":44,"value":514},"If ",{"type":38,"tag":69,"props":516,"children":518},{"className":517},[],[519],{"type":44,"value":520},"config.agent_space_id",{"type":44,"value":522}," is set, verify with:",{"type":38,"tag":382,"props":524,"children":526},{"className":384,"code":525,"language":386,"meta":387,"style":387},"aws securityagent batch-get-agent-spaces --agent-space-ids \u003Cid>\n",[527],{"type":38,"tag":69,"props":528,"children":529},{"__ignoreMap":387},[530],{"type":38,"tag":393,"props":531,"children":532},{"class":395,"line":396},[533,537,542,547,552,557,562,567],{"type":38,"tag":393,"props":534,"children":535},{"style":418},[536],{"type":44,"value":8},{"type":38,"tag":393,"props":538,"children":539},{"style":423},[540],{"type":44,"value":541}," securityagent",{"type":38,"tag":393,"props":543,"children":544},{"style":423},[545],{"type":44,"value":546}," batch-get-agent-spaces",{"type":38,"tag":393,"props":548,"children":549},{"style":423},[550],{"type":44,"value":551}," --agent-space-ids",{"type":38,"tag":393,"props":553,"children":554},{"style":412},[555],{"type":44,"value":556}," \u003C",{"type":38,"tag":393,"props":558,"children":559},{"style":423},[560],{"type":44,"value":561},"i",{"type":38,"tag":393,"props":563,"children":564},{"style":406},[565],{"type":44,"value":566},"d",{"type":38,"tag":393,"props":568,"children":569},{"style":412},[570],{"type":44,"value":571},">\n",{"type":38,"tag":573,"props":574,"children":575},"br",{},[],{"type":44,"value":577},"If the response shows it doesn't exist, treat as missing.",{"type":38,"tag":82,"props":579,"children":580},{},[581,583,606],{"type":44,"value":582},"If missing, list existing:",{"type":38,"tag":382,"props":584,"children":586},{"className":384,"code":585,"language":386,"meta":387,"style":387},"aws securityagent list-agent-spaces\n",[587],{"type":38,"tag":69,"props":588,"children":589},{"__ignoreMap":387},[590],{"type":38,"tag":393,"props":591,"children":592},{"class":395,"line":396},[593,597,601],{"type":38,"tag":393,"props":594,"children":595},{"style":418},[596],{"type":44,"value":8},{"type":38,"tag":393,"props":598,"children":599},{"style":423},[600],{"type":44,"value":541},{"type":38,"tag":393,"props":602,"children":603},{"style":423},[604],{"type":44,"value":605}," list-agent-spaces\n",{"type":38,"tag":78,"props":607,"children":608},{},[609,626,638],{"type":38,"tag":82,"props":610,"children":611},{},[612,614,619,621],{"type":44,"value":613},"If any exist → ",{"type":38,"tag":358,"props":615,"children":616},{},[617],{"type":44,"value":618},"show them to the user",{"type":44,"value":620}," with name + id and ask: \"Would you like to reuse one of these, or should I create a new one?\" Wait for the answer. ",{"type":38,"tag":358,"props":622,"children":623},{},[624],{"type":44,"value":625},"Do not auto-select.",{"type":38,"tag":82,"props":627,"children":628},{},[629,631,637],{"type":44,"value":630},"If user picks one, use that ",{"type":38,"tag":69,"props":632,"children":634},{"className":633},[],[635],{"type":44,"value":636},"agentSpaceId",{"type":44,"value":187},{"type":38,"tag":82,"props":639,"children":640},{},[641,643,676,679,681,686],{"type":44,"value":642},"If user wants new, or none exist:",{"type":38,"tag":382,"props":644,"children":646},{"className":384,"code":645,"language":386,"meta":387,"style":387},"aws securityagent create-agent-space --name security-scans\n",[647],{"type":38,"tag":69,"props":648,"children":649},{"__ignoreMap":387},[650],{"type":38,"tag":393,"props":651,"children":652},{"class":395,"line":396},[653,657,661,666,671],{"type":38,"tag":393,"props":654,"children":655},{"style":418},[656],{"type":44,"value":8},{"type":38,"tag":393,"props":658,"children":659},{"style":423},[660],{"type":44,"value":541},{"type":38,"tag":393,"props":662,"children":663},{"style":423},[664],{"type":44,"value":665}," create-agent-space",{"type":38,"tag":393,"props":667,"children":668},{"style":423},[669],{"type":44,"value":670}," --name",{"type":38,"tag":393,"props":672,"children":673},{"style":423},[674],{"type":44,"value":675}," security-scans\n",{"type":38,"tag":573,"props":677,"children":678},{},[],{"type":44,"value":680},"Capture returned ",{"type":38,"tag":69,"props":682,"children":684},{"className":683},[],[685],{"type":44,"value":636},{"type":44,"value":187},{"type":38,"tag":82,"props":688,"children":689},{},[690,695,697,703,705,711,713],{"type":38,"tag":358,"props":691,"children":692},{},[693],{"type":44,"value":694},"Service role",{"type":44,"value":696}," (",{"type":38,"tag":69,"props":698,"children":700},{"className":699},[],[701],{"type":44,"value":702},"SecurityAgentScanRole",{"type":44,"value":704},", ARN ",{"type":38,"tag":69,"props":706,"children":708},{"className":707},[],[709],{"type":44,"value":710},"arn:aws:iam::$ACCOUNT:role\u002FSecurityAgentScanRole",{"type":44,"value":712},"):",{"type":38,"tag":78,"props":714,"children":715},{},[716,755],{"type":38,"tag":82,"props":717,"children":718},{},[719,721],{"type":44,"value":720},"Probe:",{"type":38,"tag":382,"props":722,"children":724},{"className":384,"code":723,"language":386,"meta":387,"style":387},"aws iam get-role --role-name SecurityAgentScanRole\n",[725],{"type":38,"tag":69,"props":726,"children":727},{"__ignoreMap":387},[728],{"type":38,"tag":393,"props":729,"children":730},{"class":395,"line":396},[731,735,740,745,750],{"type":38,"tag":393,"props":732,"children":733},{"style":418},[734],{"type":44,"value":8},{"type":38,"tag":393,"props":736,"children":737},{"style":423},[738],{"type":44,"value":739}," iam",{"type":38,"tag":393,"props":741,"children":742},{"style":423},[743],{"type":44,"value":744}," get-role",{"type":38,"tag":393,"props":746,"children":747},{"style":423},[748],{"type":44,"value":749}," --role-name",{"type":38,"tag":393,"props":751,"children":752},{"style":423},[753],{"type":44,"value":754}," SecurityAgentScanRole\n",{"type":38,"tag":82,"props":756,"children":757},{},[758,759,765,767,772,774,780,782,788,790,796,798],{"type":44,"value":514},{"type":38,"tag":69,"props":760,"children":762},{"className":761},[],[763],{"type":44,"value":764},"NoSuchEntity",{"type":44,"value":766}," is returned, create the role. ",{"type":38,"tag":358,"props":768,"children":769},{},[770],{"type":44,"value":771},"Idempotency note:",{"type":44,"value":773}," ",{"type":38,"tag":69,"props":775,"children":777},{"className":776},[],[778],{"type":44,"value":779},"create-role",{"type":44,"value":781}," will fail with ",{"type":38,"tag":69,"props":783,"children":785},{"className":784},[],[786],{"type":44,"value":787},"EntityAlreadyExists",{"type":44,"value":789}," if the role already exists. If that happens, fall through to ",{"type":38,"tag":69,"props":791,"children":793},{"className":792},[],[794],{"type":44,"value":795},"update-assume-role-policy",{"type":44,"value":797}," to ensure the trust policy is correct.",{"type":38,"tag":382,"props":799,"children":801},{"className":384,"code":800,"language":386,"meta":387,"style":387},"# Trust policy — includes aws:SourceAccount confused-deputy guard\ncat > \u002Ftmp\u002Fsa-trust.json \u003C\u003CEOF\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"securityagent.amazonaws.com\"},\"Action\":\"sts:AssumeRole\",\"Condition\":{\"StringEquals\":{\"aws:SourceAccount\":\"${ACCOUNT}\"}}}]}\nEOF\n# Permissions policy (S3 + CloudWatch Logs)\ncat > \u002Ftmp\u002Fsa-perms.json \u003C\u003CEOF\n{\"Version\":\"2012-10-17\",\"Statement\":[\n  {\"Effect\":\"Allow\",\"Action\":[\"s3:GetObject\",\"s3:GetObjectVersion\",\"s3:ListBucket\"],\"Resource\":[\"arn:aws:s3:::security-agent-scans-${ACCOUNT}-${REGION}\",\"arn:aws:s3:::security-agent-scans-${ACCOUNT}-${REGION}\u002F*\"]},\n  {\"Effect\":\"Allow\",\"Action\":[\"logs:CreateLogGroup\",\"logs:CreateLogStream\",\"logs:PutLogEvents\"],\"Resource\":\"arn:aws:logs:*:${ACCOUNT}:log-group:\u002Faws\u002Fsecurityagent\u002F*\"}\n]}\nEOF\n\naws iam create-role --role-name SecurityAgentScanRole --assume-role-policy-document file:\u002F\u002F\u002Ftmp\u002Fsa-trust.json\n# if EntityAlreadyExists:\naws iam update-assume-role-policy --role-name SecurityAgentScanRole --policy-document file:\u002F\u002F\u002Ftmp\u002Fsa-trust.json\n# always (re)apply permissions:\naws iam put-role-policy --role-name SecurityAgentScanRole --policy-name SecurityAgentCodeReviewAccess --policy-document file:\u002F\u002F\u002Ftmp\u002Fsa-perms.json\n",[802],{"type":38,"tag":69,"props":803,"children":804},{"__ignoreMap":387},[805,814,842,870,878,887,912,921,997,1023,1032,1040,1050,1086,1095,1129,1138],{"type":38,"tag":393,"props":806,"children":807},{"class":395,"line":396},[808],{"type":38,"tag":393,"props":809,"children":811},{"style":810},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[812],{"type":44,"value":813},"# Trust policy — includes aws:SourceAccount confused-deputy guard\n",{"type":38,"tag":393,"props":815,"children":816},{"class":395,"line":459},[817,822,827,832,837],{"type":38,"tag":393,"props":818,"children":819},{"style":418},[820],{"type":44,"value":821},"cat",{"type":38,"tag":393,"props":823,"children":824},{"style":412},[825],{"type":44,"value":826}," >",{"type":38,"tag":393,"props":828,"children":829},{"style":423},[830],{"type":44,"value":831}," \u002Ftmp\u002Fsa-trust.json",{"type":38,"tag":393,"props":833,"children":834},{"style":412},[835],{"type":44,"value":836}," \u003C\u003C",{"type":38,"tag":393,"props":838,"children":839},{"style":412},[840],{"type":44,"value":841},"EOF\n",{"type":38,"tag":393,"props":843,"children":845},{"class":395,"line":844},3,[846,851,856,860,865],{"type":38,"tag":393,"props":847,"children":848},{"style":423},[849],{"type":44,"value":850},"{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"securityagent.amazonaws.com\"},\"Action\":\"sts:AssumeRole\",\"Condition\":{\"StringEquals\":{\"aws:SourceAccount\":\"",{"type":38,"tag":393,"props":852,"children":853},{"style":412},[854],{"type":44,"value":855},"${",{"type":38,"tag":393,"props":857,"children":858},{"style":406},[859],{"type":44,"value":245},{"type":38,"tag":393,"props":861,"children":862},{"style":412},[863],{"type":44,"value":864},"}",{"type":38,"tag":393,"props":866,"children":867},{"style":423},[868],{"type":44,"value":869},"\"}}}]}\n",{"type":38,"tag":393,"props":871,"children":873},{"class":395,"line":872},4,[874],{"type":38,"tag":393,"props":875,"children":876},{"style":412},[877],{"type":44,"value":841},{"type":38,"tag":393,"props":879,"children":881},{"class":395,"line":880},5,[882],{"type":38,"tag":393,"props":883,"children":884},{"style":810},[885],{"type":44,"value":886},"# Permissions policy (S3 + CloudWatch Logs)\n",{"type":38,"tag":393,"props":888,"children":890},{"class":395,"line":889},6,[891,895,899,904,908],{"type":38,"tag":393,"props":892,"children":893},{"style":418},[894],{"type":44,"value":821},{"type":38,"tag":393,"props":896,"children":897},{"style":412},[898],{"type":44,"value":826},{"type":38,"tag":393,"props":900,"children":901},{"style":423},[902],{"type":44,"value":903}," \u002Ftmp\u002Fsa-perms.json",{"type":38,"tag":393,"props":905,"children":906},{"style":412},[907],{"type":44,"value":836},{"type":38,"tag":393,"props":909,"children":910},{"style":412},[911],{"type":44,"value":841},{"type":38,"tag":393,"props":913,"children":915},{"class":395,"line":914},7,[916],{"type":38,"tag":393,"props":917,"children":918},{"style":423},[919],{"type":44,"value":920},"{\"Version\":\"2012-10-17\",\"Statement\":[\n",{"type":38,"tag":393,"props":922,"children":924},{"class":395,"line":923},8,[925,930,934,938,942,947,951,955,959,964,968,972,976,980,984,988,992],{"type":38,"tag":393,"props":926,"children":927},{"style":423},[928],{"type":44,"value":929},"  {\"Effect\":\"Allow\",\"Action\":[\"s3:GetObject\",\"s3:GetObjectVersion\",\"s3:ListBucket\"],\"Resource\":[\"arn:aws:s3:::security-agent-scans-",{"type":38,"tag":393,"props":931,"children":932},{"style":412},[933],{"type":44,"value":855},{"type":38,"tag":393,"props":935,"children":936},{"style":406},[937],{"type":44,"value":245},{"type":38,"tag":393,"props":939,"children":940},{"style":412},[941],{"type":44,"value":864},{"type":38,"tag":393,"props":943,"children":944},{"style":423},[945],{"type":44,"value":946},"-",{"type":38,"tag":393,"props":948,"children":949},{"style":412},[950],{"type":44,"value":855},{"type":38,"tag":393,"props":952,"children":953},{"style":406},[954],{"type":44,"value":266},{"type":38,"tag":393,"props":956,"children":957},{"style":412},[958],{"type":44,"value":864},{"type":38,"tag":393,"props":960,"children":961},{"style":423},[962],{"type":44,"value":963},"\",\"arn:aws:s3:::security-agent-scans-",{"type":38,"tag":393,"props":965,"children":966},{"style":412},[967],{"type":44,"value":855},{"type":38,"tag":393,"props":969,"children":970},{"style":406},[971],{"type":44,"value":245},{"type":38,"tag":393,"props":973,"children":974},{"style":412},[975],{"type":44,"value":864},{"type":38,"tag":393,"props":977,"children":978},{"style":423},[979],{"type":44,"value":946},{"type":38,"tag":393,"props":981,"children":982},{"style":412},[983],{"type":44,"value":855},{"type":38,"tag":393,"props":985,"children":986},{"style":406},[987],{"type":44,"value":266},{"type":38,"tag":393,"props":989,"children":990},{"style":412},[991],{"type":44,"value":864},{"type":38,"tag":393,"props":993,"children":994},{"style":423},[995],{"type":44,"value":996},"\u002F*\"]},\n",{"type":38,"tag":393,"props":998,"children":1000},{"class":395,"line":999},9,[1001,1006,1010,1014,1018],{"type":38,"tag":393,"props":1002,"children":1003},{"style":423},[1004],{"type":44,"value":1005},"  {\"Effect\":\"Allow\",\"Action\":[\"logs:CreateLogGroup\",\"logs:CreateLogStream\",\"logs:PutLogEvents\"],\"Resource\":\"arn:aws:logs:*:",{"type":38,"tag":393,"props":1007,"children":1008},{"style":412},[1009],{"type":44,"value":855},{"type":38,"tag":393,"props":1011,"children":1012},{"style":406},[1013],{"type":44,"value":245},{"type":38,"tag":393,"props":1015,"children":1016},{"style":412},[1017],{"type":44,"value":864},{"type":38,"tag":393,"props":1019,"children":1020},{"style":423},[1021],{"type":44,"value":1022},":log-group:\u002Faws\u002Fsecurityagent\u002F*\"}\n",{"type":38,"tag":393,"props":1024,"children":1026},{"class":395,"line":1025},10,[1027],{"type":38,"tag":393,"props":1028,"children":1029},{"style":423},[1030],{"type":44,"value":1031},"]}\n",{"type":38,"tag":393,"props":1033,"children":1035},{"class":395,"line":1034},11,[1036],{"type":38,"tag":393,"props":1037,"children":1038},{"style":412},[1039],{"type":44,"value":841},{"type":38,"tag":393,"props":1041,"children":1043},{"class":395,"line":1042},12,[1044],{"type":38,"tag":393,"props":1045,"children":1047},{"emptyLinePlaceholder":1046},true,[1048],{"type":44,"value":1049},"\n",{"type":38,"tag":393,"props":1051,"children":1053},{"class":395,"line":1052},13,[1054,1058,1062,1067,1071,1076,1081],{"type":38,"tag":393,"props":1055,"children":1056},{"style":418},[1057],{"type":44,"value":8},{"type":38,"tag":393,"props":1059,"children":1060},{"style":423},[1061],{"type":44,"value":739},{"type":38,"tag":393,"props":1063,"children":1064},{"style":423},[1065],{"type":44,"value":1066}," create-role",{"type":38,"tag":393,"props":1068,"children":1069},{"style":423},[1070],{"type":44,"value":749},{"type":38,"tag":393,"props":1072,"children":1073},{"style":423},[1074],{"type":44,"value":1075}," SecurityAgentScanRole",{"type":38,"tag":393,"props":1077,"children":1078},{"style":423},[1079],{"type":44,"value":1080}," --assume-role-policy-document",{"type":38,"tag":393,"props":1082,"children":1083},{"style":423},[1084],{"type":44,"value":1085}," file:\u002F\u002F\u002Ftmp\u002Fsa-trust.json\n",{"type":38,"tag":393,"props":1087,"children":1089},{"class":395,"line":1088},14,[1090],{"type":38,"tag":393,"props":1091,"children":1092},{"style":810},[1093],{"type":44,"value":1094},"# if EntityAlreadyExists:\n",{"type":38,"tag":393,"props":1096,"children":1098},{"class":395,"line":1097},15,[1099,1103,1107,1112,1116,1120,1125],{"type":38,"tag":393,"props":1100,"children":1101},{"style":418},[1102],{"type":44,"value":8},{"type":38,"tag":393,"props":1104,"children":1105},{"style":423},[1106],{"type":44,"value":739},{"type":38,"tag":393,"props":1108,"children":1109},{"style":423},[1110],{"type":44,"value":1111}," update-assume-role-policy",{"type":38,"tag":393,"props":1113,"children":1114},{"style":423},[1115],{"type":44,"value":749},{"type":38,"tag":393,"props":1117,"children":1118},{"style":423},[1119],{"type":44,"value":1075},{"type":38,"tag":393,"props":1121,"children":1122},{"style":423},[1123],{"type":44,"value":1124}," --policy-document",{"type":38,"tag":393,"props":1126,"children":1127},{"style":423},[1128],{"type":44,"value":1085},{"type":38,"tag":393,"props":1130,"children":1132},{"class":395,"line":1131},16,[1133],{"type":38,"tag":393,"props":1134,"children":1135},{"style":810},[1136],{"type":44,"value":1137},"# always (re)apply permissions:\n",{"type":38,"tag":393,"props":1139,"children":1141},{"class":395,"line":1140},17,[1142,1146,1150,1155,1159,1163,1168,1173,1177],{"type":38,"tag":393,"props":1143,"children":1144},{"style":418},[1145],{"type":44,"value":8},{"type":38,"tag":393,"props":1147,"children":1148},{"style":423},[1149],{"type":44,"value":739},{"type":38,"tag":393,"props":1151,"children":1152},{"style":423},[1153],{"type":44,"value":1154}," put-role-policy",{"type":38,"tag":393,"props":1156,"children":1157},{"style":423},[1158],{"type":44,"value":749},{"type":38,"tag":393,"props":1160,"children":1161},{"style":423},[1162],{"type":44,"value":1075},{"type":38,"tag":393,"props":1164,"children":1165},{"style":423},[1166],{"type":44,"value":1167}," --policy-name",{"type":38,"tag":393,"props":1169,"children":1170},{"style":423},[1171],{"type":44,"value":1172}," SecurityAgentCodeReviewAccess",{"type":38,"tag":393,"props":1174,"children":1175},{"style":423},[1176],{"type":44,"value":1124},{"type":38,"tag":393,"props":1178,"children":1179},{"style":423},[1180],{"type":44,"value":1181}," file:\u002F\u002F\u002Ftmp\u002Fsa-perms.json\n",{"type":38,"tag":82,"props":1183,"children":1184},{},[1185,1190,1191,1197,1198],{"type":38,"tag":358,"props":1186,"children":1187},{},[1188],{"type":44,"value":1189},"S3 bucket",{"type":44,"value":696},{"type":38,"tag":69,"props":1192,"children":1194},{"className":1193},[],[1195],{"type":44,"value":1196},"security-agent-scans-$ACCOUNT-$REGION",{"type":44,"value":712},{"type":38,"tag":78,"props":1199,"children":1200},{},[1201,1299,1413],{"type":38,"tag":82,"props":1202,"children":1203},{},[1204,1205],{"type":44,"value":720},{"type":38,"tag":382,"props":1206,"children":1208},{"className":384,"code":1207,"language":386,"meta":387,"style":387},"BUCKET=\"security-agent-scans-${ACCOUNT}-${REGION}\"\naws s3api head-bucket --bucket \"$BUCKET\"\n",[1209],{"type":38,"tag":69,"props":1210,"children":1211},{"__ignoreMap":387},[1212,1262],{"type":38,"tag":393,"props":1213,"children":1214},{"class":395,"line":396},[1215,1220,1224,1229,1234,1238,1242,1246,1250,1254,1258],{"type":38,"tag":393,"props":1216,"children":1217},{"style":406},[1218],{"type":44,"value":1219},"BUCKET",{"type":38,"tag":393,"props":1221,"children":1222},{"style":412},[1223],{"type":44,"value":474},{"type":38,"tag":393,"props":1225,"children":1226},{"style":412},[1227],{"type":44,"value":1228},"\"",{"type":38,"tag":393,"props":1230,"children":1231},{"style":423},[1232],{"type":44,"value":1233},"security-agent-scans-",{"type":38,"tag":393,"props":1235,"children":1236},{"style":412},[1237],{"type":44,"value":855},{"type":38,"tag":393,"props":1239,"children":1240},{"style":406},[1241],{"type":44,"value":245},{"type":38,"tag":393,"props":1243,"children":1244},{"style":412},[1245],{"type":44,"value":864},{"type":38,"tag":393,"props":1247,"children":1248},{"style":423},[1249],{"type":44,"value":946},{"type":38,"tag":393,"props":1251,"children":1252},{"style":412},[1253],{"type":44,"value":855},{"type":38,"tag":393,"props":1255,"children":1256},{"style":406},[1257],{"type":44,"value":266},{"type":38,"tag":393,"props":1259,"children":1260},{"style":412},[1261],{"type":44,"value":498},{"type":38,"tag":393,"props":1263,"children":1264},{"class":395,"line":459},[1265,1269,1274,1279,1284,1289,1294],{"type":38,"tag":393,"props":1266,"children":1267},{"style":418},[1268],{"type":44,"value":8},{"type":38,"tag":393,"props":1270,"children":1271},{"style":423},[1272],{"type":44,"value":1273}," s3api",{"type":38,"tag":393,"props":1275,"children":1276},{"style":423},[1277],{"type":44,"value":1278}," head-bucket",{"type":38,"tag":393,"props":1280,"children":1281},{"style":423},[1282],{"type":44,"value":1283}," --bucket",{"type":38,"tag":393,"props":1285,"children":1286},{"style":412},[1287],{"type":44,"value":1288}," \"",{"type":38,"tag":393,"props":1290,"children":1291},{"style":406},[1292],{"type":44,"value":1293},"$BUCKET",{"type":38,"tag":393,"props":1295,"children":1296},{"style":412},[1297],{"type":44,"value":1298},"\"\n",{"type":38,"tag":82,"props":1300,"children":1301},{},[1302,1304],{"type":44,"value":1303},"If 404, create:",{"type":38,"tag":382,"props":1305,"children":1307},{"className":384,"code":1306,"language":386,"meta":387,"style":387},"# us-east-1: no LocationConstraint\naws s3api create-bucket --bucket \"$BUCKET\"\n# other regions:\naws s3api create-bucket --bucket \"$BUCKET\" --create-bucket-configuration LocationConstraint=\"$REGION\"\n",[1308],{"type":38,"tag":69,"props":1309,"children":1310},{"__ignoreMap":387},[1311,1319,1351,1359],{"type":38,"tag":393,"props":1312,"children":1313},{"class":395,"line":396},[1314],{"type":38,"tag":393,"props":1315,"children":1316},{"style":810},[1317],{"type":44,"value":1318},"# us-east-1: no LocationConstraint\n",{"type":38,"tag":393,"props":1320,"children":1321},{"class":395,"line":459},[1322,1326,1330,1335,1339,1343,1347],{"type":38,"tag":393,"props":1323,"children":1324},{"style":418},[1325],{"type":44,"value":8},{"type":38,"tag":393,"props":1327,"children":1328},{"style":423},[1329],{"type":44,"value":1273},{"type":38,"tag":393,"props":1331,"children":1332},{"style":423},[1333],{"type":44,"value":1334}," create-bucket",{"type":38,"tag":393,"props":1336,"children":1337},{"style":423},[1338],{"type":44,"value":1283},{"type":38,"tag":393,"props":1340,"children":1341},{"style":412},[1342],{"type":44,"value":1288},{"type":38,"tag":393,"props":1344,"children":1345},{"style":406},[1346],{"type":44,"value":1293},{"type":38,"tag":393,"props":1348,"children":1349},{"style":412},[1350],{"type":44,"value":1298},{"type":38,"tag":393,"props":1352,"children":1353},{"class":395,"line":844},[1354],{"type":38,"tag":393,"props":1355,"children":1356},{"style":810},[1357],{"type":44,"value":1358},"# other regions:\n",{"type":38,"tag":393,"props":1360,"children":1361},{"class":395,"line":872},[1362,1366,1370,1374,1378,1382,1386,1390,1395,1400,1404,1409],{"type":38,"tag":393,"props":1363,"children":1364},{"style":418},[1365],{"type":44,"value":8},{"type":38,"tag":393,"props":1367,"children":1368},{"style":423},[1369],{"type":44,"value":1273},{"type":38,"tag":393,"props":1371,"children":1372},{"style":423},[1373],{"type":44,"value":1334},{"type":38,"tag":393,"props":1375,"children":1376},{"style":423},[1377],{"type":44,"value":1283},{"type":38,"tag":393,"props":1379,"children":1380},{"style":412},[1381],{"type":44,"value":1288},{"type":38,"tag":393,"props":1383,"children":1384},{"style":406},[1385],{"type":44,"value":1293},{"type":38,"tag":393,"props":1387,"children":1388},{"style":412},[1389],{"type":44,"value":1228},{"type":38,"tag":393,"props":1391,"children":1392},{"style":423},[1393],{"type":44,"value":1394}," --create-bucket-configuration",{"type":38,"tag":393,"props":1396,"children":1397},{"style":423},[1398],{"type":44,"value":1399}," LocationConstraint=",{"type":38,"tag":393,"props":1401,"children":1402},{"style":412},[1403],{"type":44,"value":1228},{"type":38,"tag":393,"props":1405,"children":1406},{"style":406},[1407],{"type":44,"value":1408},"$REGION",{"type":38,"tag":393,"props":1410,"children":1411},{"style":412},[1412],{"type":44,"value":1298},{"type":38,"tag":82,"props":1414,"children":1415},{},[1416,1418],{"type":44,"value":1417},"Always (re)apply public access block + 30-day lifecycle:",{"type":38,"tag":382,"props":1419,"children":1421},{"className":384,"code":1420,"language":386,"meta":387,"style":387},"aws s3api put-public-access-block --bucket \"$BUCKET\" \\\n  --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true\n\ncat > \u002Ftmp\u002Fsa-lifecycle.json \u003C\u003C'EOF'\n{\"Rules\":[{\"ID\":\"AutoDeleteUploads\",\"Status\":\"Enabled\",\"Filter\":{\"Prefix\":\"\"},\"Expiration\":{\"Days\":30}}]}\nEOF\naws s3api put-bucket-lifecycle-configuration --bucket \"$BUCKET\" --lifecycle-configuration file:\u002F\u002F\u002Ftmp\u002Fsa-lifecycle.json\n",[1422],{"type":38,"tag":69,"props":1423,"children":1424},{"__ignoreMap":387},[1425,1462,1508,1515,1540,1548,1555],{"type":38,"tag":393,"props":1426,"children":1427},{"class":395,"line":396},[1428,1432,1436,1441,1445,1449,1453,1457],{"type":38,"tag":393,"props":1429,"children":1430},{"style":418},[1431],{"type":44,"value":8},{"type":38,"tag":393,"props":1433,"children":1434},{"style":423},[1435],{"type":44,"value":1273},{"type":38,"tag":393,"props":1437,"children":1438},{"style":423},[1439],{"type":44,"value":1440}," put-public-access-block",{"type":38,"tag":393,"props":1442,"children":1443},{"style":423},[1444],{"type":44,"value":1283},{"type":38,"tag":393,"props":1446,"children":1447},{"style":412},[1448],{"type":44,"value":1288},{"type":38,"tag":393,"props":1450,"children":1451},{"style":406},[1452],{"type":44,"value":1293},{"type":38,"tag":393,"props":1454,"children":1455},{"style":412},[1456],{"type":44,"value":1228},{"type":38,"tag":393,"props":1458,"children":1459},{"style":406},[1460],{"type":44,"value":1461}," \\\n",{"type":38,"tag":393,"props":1463,"children":1464},{"class":395,"line":459},[1465,1470,1475,1480,1485,1489,1494,1498,1503],{"type":38,"tag":393,"props":1466,"children":1467},{"style":423},[1468],{"type":44,"value":1469},"  --public-access-block-configuration",{"type":38,"tag":393,"props":1471,"children":1472},{"style":423},[1473],{"type":44,"value":1474}," BlockPublicAcls=",{"type":38,"tag":393,"props":1476,"children":1477},{"style":412},[1478],{"type":44,"value":1479},"true",{"type":38,"tag":393,"props":1481,"children":1482},{"style":423},[1483],{"type":44,"value":1484},",IgnorePublicAcls=",{"type":38,"tag":393,"props":1486,"children":1487},{"style":412},[1488],{"type":44,"value":1479},{"type":38,"tag":393,"props":1490,"children":1491},{"style":423},[1492],{"type":44,"value":1493},",BlockPublicPolicy=",{"type":38,"tag":393,"props":1495,"children":1496},{"style":412},[1497],{"type":44,"value":1479},{"type":38,"tag":393,"props":1499,"children":1500},{"style":423},[1501],{"type":44,"value":1502},",RestrictPublicBuckets=",{"type":38,"tag":393,"props":1504,"children":1505},{"style":412},[1506],{"type":44,"value":1507},"true\n",{"type":38,"tag":393,"props":1509,"children":1510},{"class":395,"line":844},[1511],{"type":38,"tag":393,"props":1512,"children":1513},{"emptyLinePlaceholder":1046},[1514],{"type":44,"value":1049},{"type":38,"tag":393,"props":1516,"children":1517},{"class":395,"line":872},[1518,1522,1526,1531,1535],{"type":38,"tag":393,"props":1519,"children":1520},{"style":418},[1521],{"type":44,"value":821},{"type":38,"tag":393,"props":1523,"children":1524},{"style":412},[1525],{"type":44,"value":826},{"type":38,"tag":393,"props":1527,"children":1528},{"style":423},[1529],{"type":44,"value":1530}," \u002Ftmp\u002Fsa-lifecycle.json",{"type":38,"tag":393,"props":1532,"children":1533},{"style":412},[1534],{"type":44,"value":836},{"type":38,"tag":393,"props":1536,"children":1537},{"style":412},[1538],{"type":44,"value":1539},"'EOF'\n",{"type":38,"tag":393,"props":1541,"children":1542},{"class":395,"line":880},[1543],{"type":38,"tag":393,"props":1544,"children":1545},{"style":423},[1546],{"type":44,"value":1547},"{\"Rules\":[{\"ID\":\"AutoDeleteUploads\",\"Status\":\"Enabled\",\"Filter\":{\"Prefix\":\"\"},\"Expiration\":{\"Days\":30}}]}\n",{"type":38,"tag":393,"props":1549,"children":1550},{"class":395,"line":889},[1551],{"type":38,"tag":393,"props":1552,"children":1553},{"style":412},[1554],{"type":44,"value":841},{"type":38,"tag":393,"props":1556,"children":1557},{"class":395,"line":914},[1558,1562,1566,1571,1575,1579,1583,1587,1592],{"type":38,"tag":393,"props":1559,"children":1560},{"style":418},[1561],{"type":44,"value":8},{"type":38,"tag":393,"props":1563,"children":1564},{"style":423},[1565],{"type":44,"value":1273},{"type":38,"tag":393,"props":1567,"children":1568},{"style":423},[1569],{"type":44,"value":1570}," put-bucket-lifecycle-configuration",{"type":38,"tag":393,"props":1572,"children":1573},{"style":423},[1574],{"type":44,"value":1283},{"type":38,"tag":393,"props":1576,"children":1577},{"style":412},[1578],{"type":44,"value":1288},{"type":38,"tag":393,"props":1580,"children":1581},{"style":406},[1582],{"type":44,"value":1293},{"type":38,"tag":393,"props":1584,"children":1585},{"style":412},[1586],{"type":44,"value":1228},{"type":38,"tag":393,"props":1588,"children":1589},{"style":423},[1590],{"type":44,"value":1591}," --lifecycle-configuration",{"type":38,"tag":393,"props":1593,"children":1594},{"style":423},[1595],{"type":44,"value":1596}," file:\u002F\u002F\u002Ftmp\u002Fsa-lifecycle.json\n",{"type":38,"tag":82,"props":1598,"children":1599},{},[1600,1605],{"type":38,"tag":358,"props":1601,"children":1602},{},[1603],{"type":44,"value":1604},"Register role + bucket on the agent space (idempotent):",{"type":38,"tag":78,"props":1606,"children":1607},{},[1608,1674],{"type":38,"tag":82,"props":1609,"children":1610},{},[1611,1613,1654,1657,1659,1665,1667,1673],{"type":44,"value":1612},"Read existing resources:",{"type":38,"tag":382,"props":1614,"children":1615},{"className":384,"code":525,"language":386,"meta":387,"style":387},[1616],{"type":38,"tag":69,"props":1617,"children":1618},{"__ignoreMap":387},[1619],{"type":38,"tag":393,"props":1620,"children":1621},{"class":395,"line":396},[1622,1626,1630,1634,1638,1642,1646,1650],{"type":38,"tag":393,"props":1623,"children":1624},{"style":418},[1625],{"type":44,"value":8},{"type":38,"tag":393,"props":1627,"children":1628},{"style":423},[1629],{"type":44,"value":541},{"type":38,"tag":393,"props":1631,"children":1632},{"style":423},[1633],{"type":44,"value":546},{"type":38,"tag":393,"props":1635,"children":1636},{"style":423},[1637],{"type":44,"value":551},{"type":38,"tag":393,"props":1639,"children":1640},{"style":412},[1641],{"type":44,"value":556},{"type":38,"tag":393,"props":1643,"children":1644},{"style":423},[1645],{"type":44,"value":561},{"type":38,"tag":393,"props":1647,"children":1648},{"style":406},[1649],{"type":44,"value":566},{"type":38,"tag":393,"props":1651,"children":1652},{"style":412},[1653],{"type":44,"value":571},{"type":38,"tag":573,"props":1655,"children":1656},{},[],{"type":44,"value":1658},"Look at ",{"type":38,"tag":69,"props":1660,"children":1662},{"className":1661},[],[1663],{"type":44,"value":1664},"agentSpaces[0].awsResources.iamRoles",{"type":44,"value":1666}," and ",{"type":38,"tag":69,"props":1668,"children":1670},{"className":1669},[],[1671],{"type":44,"value":1672},"awsResources.s3Buckets",{"type":44,"value":187},{"type":38,"tag":82,"props":1675,"children":1676},{},[1677,1679],{"type":44,"value":1678},"If the role ARN or the bucket name is missing from those lists, merge and update:",{"type":38,"tag":382,"props":1680,"children":1682},{"className":384,"code":1681,"language":386,"meta":387,"style":387},"aws securityagent update-agent-space --agent-space-id \u003Cid> --name \u003Cexisting-name> \\\n  --aws-resources iamRoles=[\u003Carn1>,\u003Carn2>...],s3Buckets=[\u003Cbucket1>,\u003Cbucket2>...]\n",[1683],{"type":38,"tag":69,"props":1684,"children":1685},{"__ignoreMap":387},[1686,1750],{"type":38,"tag":393,"props":1687,"children":1688},{"class":395,"line":396},[1689,1693,1697,1702,1707,1711,1715,1719,1724,1728,1732,1737,1742,1746],{"type":38,"tag":393,"props":1690,"children":1691},{"style":418},[1692],{"type":44,"value":8},{"type":38,"tag":393,"props":1694,"children":1695},{"style":423},[1696],{"type":44,"value":541},{"type":38,"tag":393,"props":1698,"children":1699},{"style":423},[1700],{"type":44,"value":1701}," update-agent-space",{"type":38,"tag":393,"props":1703,"children":1704},{"style":423},[1705],{"type":44,"value":1706}," --agent-space-id",{"type":38,"tag":393,"props":1708,"children":1709},{"style":412},[1710],{"type":44,"value":556},{"type":38,"tag":393,"props":1712,"children":1713},{"style":423},[1714],{"type":44,"value":561},{"type":38,"tag":393,"props":1716,"children":1717},{"style":406},[1718],{"type":44,"value":566},{"type":38,"tag":393,"props":1720,"children":1721},{"style":412},[1722],{"type":44,"value":1723},">",{"type":38,"tag":393,"props":1725,"children":1726},{"style":423},[1727],{"type":44,"value":670},{"type":38,"tag":393,"props":1729,"children":1730},{"style":412},[1731],{"type":44,"value":556},{"type":38,"tag":393,"props":1733,"children":1734},{"style":423},[1735],{"type":44,"value":1736},"existing-nam",{"type":38,"tag":393,"props":1738,"children":1739},{"style":406},[1740],{"type":44,"value":1741},"e",{"type":38,"tag":393,"props":1743,"children":1744},{"style":412},[1745],{"type":44,"value":1723},{"type":38,"tag":393,"props":1747,"children":1748},{"style":406},[1749],{"type":44,"value":1461},{"type":38,"tag":393,"props":1751,"children":1752},{"class":395,"line":459},[1753,1758,1763,1768,1773,1778,1783,1787,1791,1796,1801,1805,1810,1814,1818,1822,1826,1830],{"type":38,"tag":393,"props":1754,"children":1755},{"style":423},[1756],{"type":44,"value":1757},"  --aws-resources",{"type":38,"tag":393,"props":1759,"children":1760},{"style":423},[1761],{"type":44,"value":1762}," iamRoles=[",{"type":38,"tag":393,"props":1764,"children":1765},{"style":412},[1766],{"type":44,"value":1767},"\u003C",{"type":38,"tag":393,"props":1769,"children":1770},{"style":423},[1771],{"type":44,"value":1772},"arn",{"type":38,"tag":393,"props":1774,"children":1775},{"style":412},[1776],{"type":44,"value":1777},"1>",{"type":38,"tag":393,"props":1779,"children":1780},{"style":423},[1781],{"type":44,"value":1782},",",{"type":38,"tag":393,"props":1784,"children":1785},{"style":412},[1786],{"type":44,"value":1767},{"type":38,"tag":393,"props":1788,"children":1789},{"style":423},[1790],{"type":44,"value":1772},{"type":38,"tag":393,"props":1792,"children":1793},{"style":412},[1794],{"type":44,"value":1795},"2>",{"type":38,"tag":393,"props":1797,"children":1798},{"style":423},[1799],{"type":44,"value":1800},"...],s3Buckets=[",{"type":38,"tag":393,"props":1802,"children":1803},{"style":412},[1804],{"type":44,"value":1767},{"type":38,"tag":393,"props":1806,"children":1807},{"style":423},[1808],{"type":44,"value":1809},"bucket",{"type":38,"tag":393,"props":1811,"children":1812},{"style":412},[1813],{"type":44,"value":1777},{"type":38,"tag":393,"props":1815,"children":1816},{"style":423},[1817],{"type":44,"value":1782},{"type":38,"tag":393,"props":1819,"children":1820},{"style":412},[1821],{"type":44,"value":1767},{"type":38,"tag":393,"props":1823,"children":1824},{"style":423},[1825],{"type":44,"value":1809},{"type":38,"tag":393,"props":1827,"children":1828},{"style":412},[1829],{"type":44,"value":1795},{"type":38,"tag":393,"props":1831,"children":1832},{"style":423},[1833],{"type":44,"value":1834},"...]\n",{"type":38,"tag":82,"props":1836,"children":1837},{},[1838,1843,1845,1850,1852],{"type":38,"tag":358,"props":1839,"children":1840},{},[1841],{"type":44,"value":1842},"Persist",{"type":44,"value":1844}," to ",{"type":38,"tag":69,"props":1846,"children":1848},{"className":1847},[],[1849],{"type":44,"value":370},{"type":44,"value":1851}," (minimal — account\u002Frole\u002Fbucket are derived):",{"type":38,"tag":382,"props":1853,"children":1857},{"className":1854,"code":1855,"language":1856,"meta":387,"style":387},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"agent_space_id\": \"as-xxxxx\",\n  \"region\": \"us-east-1\"\n}\n","json",[1858],{"type":38,"tag":69,"props":1859,"children":1860},{"__ignoreMap":387},[1861,1869,1907,1939],{"type":38,"tag":393,"props":1862,"children":1863},{"class":395,"line":396},[1864],{"type":38,"tag":393,"props":1865,"children":1866},{"style":412},[1867],{"type":44,"value":1868},"{\n",{"type":38,"tag":393,"props":1870,"children":1871},{"class":395,"line":459},[1872,1877,1881,1885,1889,1893,1898,1902],{"type":38,"tag":393,"props":1873,"children":1874},{"style":412},[1875],{"type":44,"value":1876},"  \"",{"type":38,"tag":393,"props":1878,"children":1879},{"style":400},[1880],{"type":44,"value":338},{"type":38,"tag":393,"props":1882,"children":1883},{"style":412},[1884],{"type":44,"value":1228},{"type":38,"tag":393,"props":1886,"children":1887},{"style":412},[1888],{"type":44,"value":76},{"type":38,"tag":393,"props":1890,"children":1891},{"style":412},[1892],{"type":44,"value":1288},{"type":38,"tag":393,"props":1894,"children":1895},{"style":423},[1896],{"type":44,"value":1897},"as-xxxxx",{"type":38,"tag":393,"props":1899,"children":1900},{"style":412},[1901],{"type":44,"value":1228},{"type":38,"tag":393,"props":1903,"children":1904},{"style":412},[1905],{"type":44,"value":1906},",\n",{"type":38,"tag":393,"props":1908,"children":1909},{"class":395,"line":844},[1910,1914,1919,1923,1927,1931,1935],{"type":38,"tag":393,"props":1911,"children":1912},{"style":412},[1913],{"type":44,"value":1876},{"type":38,"tag":393,"props":1915,"children":1916},{"style":400},[1917],{"type":44,"value":1918},"region",{"type":38,"tag":393,"props":1920,"children":1921},{"style":412},[1922],{"type":44,"value":1228},{"type":38,"tag":393,"props":1924,"children":1925},{"style":412},[1926],{"type":44,"value":76},{"type":38,"tag":393,"props":1928,"children":1929},{"style":412},[1930],{"type":44,"value":1288},{"type":38,"tag":393,"props":1932,"children":1933},{"style":423},[1934],{"type":44,"value":283},{"type":38,"tag":393,"props":1936,"children":1937},{"style":412},[1938],{"type":44,"value":1298},{"type":38,"tag":393,"props":1940,"children":1941},{"class":395,"line":872},[1942],{"type":38,"tag":393,"props":1943,"children":1944},{"style":412},[1945],{"type":44,"value":1946},"}\n",{"type":38,"tag":82,"props":1948,"children":1949},{},[1950,1955,1957],{"type":38,"tag":358,"props":1951,"children":1952},{},[1953],{"type":44,"value":1954},"Create gitignore",{"type":44,"value":1956}," if missing:",{"type":38,"tag":382,"props":1958,"children":1960},{"className":384,"code":1959,"language":386,"meta":387,"style":387},"mkdir -p .security-agent\necho '*' > .security-agent\u002F.gitignore\n",[1961],{"type":38,"tag":69,"props":1962,"children":1963},{"__ignoreMap":387},[1964,1982],{"type":38,"tag":393,"props":1965,"children":1966},{"class":395,"line":396},[1967,1972,1977],{"type":38,"tag":393,"props":1968,"children":1969},{"style":418},[1970],{"type":44,"value":1971},"mkdir",{"type":38,"tag":393,"props":1973,"children":1974},{"style":423},[1975],{"type":44,"value":1976}," -p",{"type":38,"tag":393,"props":1978,"children":1979},{"style":423},[1980],{"type":44,"value":1981}," .security-agent\n",{"type":38,"tag":393,"props":1983,"children":1984},{"class":395,"line":459},[1985,1991,1996,2000,2005,2009],{"type":38,"tag":393,"props":1986,"children":1988},{"style":1987},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[1989],{"type":44,"value":1990},"echo",{"type":38,"tag":393,"props":1992,"children":1993},{"style":412},[1994],{"type":44,"value":1995}," '",{"type":38,"tag":393,"props":1997,"children":1998},{"style":423},[1999],{"type":44,"value":155},{"type":38,"tag":393,"props":2001,"children":2002},{"style":412},[2003],{"type":44,"value":2004},"'",{"type":38,"tag":393,"props":2006,"children":2007},{"style":412},[2008],{"type":44,"value":826},{"type":38,"tag":393,"props":2010,"children":2011},{"style":423},[2012],{"type":44,"value":2013}," .security-agent\u002F.gitignore\n",{"type":38,"tag":82,"props":2015,"children":2016},{},[2017],{"type":44,"value":2018},"Confirm to user: \"Setup complete. You can run security scans or pentests now.\"",{"type":38,"tag":53,"props":2020,"children":2021},{},[],{"type":38,"tag":57,"props":2023,"children":2025},{"id":2024},"rules",[2026],{"type":44,"value":2027},"Rules",{"type":38,"tag":78,"props":2029,"children":2030},{},[2031,2036,2041,2062,2081],{"type":38,"tag":82,"props":2032,"children":2033},{},[2034],{"type":44,"value":2035},"Never auto-select an agent space when multiple exist — always ask the user",{"type":38,"tag":82,"props":2037,"children":2038},{},[2039],{"type":44,"value":2040},"Never disable safety protections (the public-access-block stays on)",{"type":38,"tag":82,"props":2042,"children":2043},{},[2044,2046,2052,2054,2060],{"type":44,"value":2045},"Trust policy must allow ",{"type":38,"tag":69,"props":2047,"children":2049},{"className":2048},[],[2050],{"type":44,"value":2051},"securityagent.amazonaws.com",{"type":44,"value":2053}," (production service principal) and include the ",{"type":38,"tag":69,"props":2055,"children":2057},{"className":2056},[],[2058],{"type":44,"value":2059},"aws:SourceAccount",{"type":44,"value":2061}," confused-deputy guard",{"type":38,"tag":82,"props":2063,"children":2064},{},[2065,2067,2072,2074,2079],{"type":44,"value":2066},"If the user provides their own role name or bucket name (different from the conventional defaults), tell them: this plugin uses convention-based defaults (",{"type":38,"tag":69,"props":2068,"children":2070},{"className":2069},[],[2071],{"type":44,"value":702},{"type":44,"value":2073}," \u002F ",{"type":38,"tag":69,"props":2075,"children":2077},{"className":2076},[],[2078],{"type":44,"value":327},{"type":44,"value":2080},"). Either accept those defaults or extend the skill — the other skills derive these names rather than reading them from config.",{"type":38,"tag":82,"props":2082,"children":2083},{},[2084,2086,2091],{"type":44,"value":2085},"The scan and pentest skills can call this skill inline if ",{"type":38,"tag":69,"props":2087,"children":2089},{"className":2088},[],[2090],{"type":44,"value":90},{"type":44,"value":2092}," is missing — first-time users don't need to run setup separately.",{"type":38,"tag":53,"props":2094,"children":2095},{},[],{"type":38,"tag":57,"props":2097,"children":2099},{"id":2098},"troubleshooting",[2100],{"type":44,"value":2101},"Troubleshooting",{"type":38,"tag":78,"props":2103,"children":2104},{},[2105,2141,2170,2187],{"type":38,"tag":82,"props":2106,"children":2107},{},[2108,2125,2127,2132,2134,2140],{"type":38,"tag":358,"props":2109,"children":2110},{},[2111,2117,2119],{"type":38,"tag":69,"props":2112,"children":2114},{"className":2113},[],[2115],{"type":44,"value":2116},"AccessDenied",{"type":44,"value":2118}," calling ",{"type":38,"tag":69,"props":2120,"children":2122},{"className":2121},[],[2123],{"type":44,"value":2124},"iam:CreateRole",{"type":44,"value":2126}," → user lacks IAM permissions. Ask them to run setup with their own role ARN, or to grant ",{"type":38,"tag":69,"props":2128,"children":2130},{"className":2129},[],[2131],{"type":44,"value":2124},{"type":44,"value":2133}," + ",{"type":38,"tag":69,"props":2135,"children":2137},{"className":2136},[],[2138],{"type":44,"value":2139},"iam:PutRolePolicy",{"type":44,"value":187},{"type":38,"tag":82,"props":2142,"children":2143},{},[2144,2160,2162,2168],{"type":38,"tag":358,"props":2145,"children":2146},{},[2147,2152,2154],{"type":38,"tag":69,"props":2148,"children":2150},{"className":2149},[],[2151],{"type":44,"value":2116},{"type":44,"value":2153}," on ",{"type":38,"tag":69,"props":2155,"children":2157},{"className":2156},[],[2158],{"type":44,"value":2159},"s3api create-bucket",{"type":44,"value":2161}," → either the bucket name is taken globally, or the user lacks ",{"type":38,"tag":69,"props":2163,"children":2165},{"className":2164},[],[2166],{"type":44,"value":2167},"s3:CreateBucket",{"type":44,"value":2169},". Suggest using an existing bucket they own and pass it explicitly.",{"type":38,"tag":82,"props":2171,"children":2172},{},[2173,2178,2180,2185],{"type":38,"tag":358,"props":2174,"children":2175},{},[2176],{"type":44,"value":2177},"Role exists but trust policy is wrong",{"type":44,"value":2179}," → ",{"type":38,"tag":69,"props":2181,"children":2183},{"className":2182},[],[2184],{"type":44,"value":795},{"type":44,"value":2186}," (step 4 fallback). If they don't want that role updated, ask them for a different role ARN.",{"type":38,"tag":82,"props":2188,"children":2189},{},[2190,2195],{"type":38,"tag":358,"props":2191,"children":2192},{},[2193],{"type":44,"value":2194},"Agent space exists but in a different region",{"type":44,"value":2196}," → tell the user; suggest using the right region or creating a new space in the current region.",{"type":38,"tag":2198,"props":2199,"children":2200},"style",{},[2201],{"type":44,"value":2202},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2204,"total":2306},[2205,2222,2237,2252,2267,2277,2290],{"slug":2206,"name":2206,"fn":2207,"description":2208,"org":2209,"tags":2210,"stars":21,"repoUrl":22,"updatedAt":2221},"agents-build","add capabilities to existing agent projects","Use when adding capabilities to an existing agent project — memory, app integration, VPC, multi-agent, migration, model changes, browser, code interpreter, or resource removal. Triggers on: \"add memory\", \"remember across sessions\", \"call agent from app\", \"invoke agent from code\", \"auth to call agent\", \"streaming responses\", \"VPC\", \"VPC connectivity\", \"VPC error\", \"can't reach from VPC\", \"multi-agent\", \"A2A\", \"A2A auth\", \"orchestrator not delegating\", \"specialist not called\", \"migrate Bedrock Agent\", \"after import\", \"migration issue\", \"framework for migration\", \"change model\", \"browser tool\", \"code interpreter\", \"delete agent\", \"tear down\", \"agentcore remove\", \"cross-account memory\", \"resource-based policy on memory\", \"pay for x402 content\", \"402 Payment Required\", \"microtransactions\", \"paid API or tool\". Not for connecting to external APIs via Gateway — use agents-connect. Not for scaffolding a new project — use agents-get-started. Not for CLI\u002Fdev server errors — use agents-debug. Strands vs LangGraph in a migration context routes here.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2211,2214,2217,2218],{"name":2212,"slug":2213,"type":15},"Agents","agents",{"name":2215,"slug":2216,"type":15},"Automation","automation",{"name":20,"slug":8,"type":15},{"name":2219,"slug":2220,"type":15},"Engineering","engineering","2026-07-12T08:42:53.812877",{"slug":2223,"name":2223,"fn":2224,"description":2225,"org":2226,"tags":2227,"stars":21,"repoUrl":22,"updatedAt":2236},"agents-connect","connect agents to external services","Use when connecting your agent to external APIs, tools, or services via Gateway, or restricting tool access with Cedar policies. Handles gateway setup, target types, outbound auth (OAuth, API key, IAM), credentials, and Cedar policy authoring. Triggers on: \"connect to API\", \"add gateway\", \"connect to MCP server\", \"Lambda tools\", \"OpenAPI\", \"gateway target\", \"Cedar policy\", \"restrict tools\", \"policy engine\", \"gateway auth error\", \"store API key\", \"outbound credential\", \"env var API key\", \"API key None after deploy\", \"credential not available after deploy\", \"should this be a gateway target\", \"give my agent tools\", \"add tools to agent\". Not for inbound auth (who can call your agent) — use agents-harden. Not for debugging agent behavior — use agents-debug. Not for VPC networking errors (agent can't reach APIs due to VPC) — use agents-build. Not for creating or hosting a new MCP server project — use agents-get-started.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2228,2229,2232,2235],{"name":2212,"slug":2213,"type":15},{"name":2230,"slug":2231,"type":15},"API Development","api-development",{"name":2233,"slug":2234,"type":15},"Authentication","authentication",{"name":20,"slug":8,"type":15},"2026-07-16T06:00:38.866147",{"slug":2238,"name":2238,"fn":2239,"description":2240,"org":2241,"tags":2242,"stars":21,"repoUrl":22,"updatedAt":2251},"agents-debug","debug agent and environment issues","Use when your agent or environment is broken — wrong answers, errors, timeouts, tool failures, or CLI issues. Reads traces and logs to diagnose root causes. Also checks prerequisites when the CLI itself isn't working. Triggers on: \"agent not working\", \"wrong answer\", \"agent error\", \"tool call failing\", \"debug agent\", \"check logs\", \"read traces\", \"broken\", \"500 error\", \"424 error\", \"model access denied\", \"command not found\", \"stuck in DELETING\", \"maxVms exceeded\", \"cold start diagnosis\", \"cold start slow\", \"agentcore create error\", \"create failed\", \"exit code 7\", \"connection refused local dev\". Not for deploy failures — use agents-deploy. Not for performance tuning without errors — use agents-optimize. Not for VPC configuration — use agents-build. Not for observability setup or missing logs — use agents-optimize.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2243,2244,2245,2248],{"name":2212,"slug":2213,"type":15},{"name":20,"slug":8,"type":15},{"name":2246,"slug":2247,"type":15},"Debugging","debugging",{"name":2249,"slug":2250,"type":15},"Observability","observability","2026-07-16T06:00:44.679093",{"slug":2253,"name":2253,"fn":2254,"description":2255,"org":2256,"tags":2257,"stars":21,"repoUrl":22,"updatedAt":2266},"agents-deploy","deploy AI agents to AWS","Use when deploying your agent to AWS, or when a deploy has failed. Handles pre-flight validation, CDK\u002FIAM\u002Fquota error diagnosis, version management, rollback, and canary deployments. Triggers on: \"deploy my agent\", \"agentcore deploy\", \"deploy failed\", \"CDK error\", \"rollback\", \"canary deploy\", \"pin version\", \"redeploy\", \"deploy stuck\". Not for production hardening — use agents-harden. Not for adding capabilities before deploy — use agents-build or agents-connect. Not for VPC configuration errors — use agents-build.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2258,2259,2260,2263],{"name":2212,"slug":2213,"type":15},{"name":20,"slug":8,"type":15},{"name":2261,"slug":2262,"type":15},"CI\u002FCD","ci-cd",{"name":2264,"slug":2265,"type":15},"Deployment","deployment","2026-07-12T08:42:55.059577",{"slug":2268,"name":2268,"fn":2269,"description":2270,"org":2271,"tags":2272,"stars":21,"repoUrl":22,"updatedAt":2276},"agents-get-started","scaffold and deploy new agent projects","Use when a developer wants to create a new agent project or get started with AgentCore. Handles framework selection, project scaffolding, first deploy, and first invocation. Triggers on: \"build an agent\", \"create an agent\", \"get started\", \"new project\", \"agentcore create\", \"which framework\", \"Strands vs LangGraph\", \"hello world agent\", \"first agent\", \"create MCP server\", \"host MCP server\", \"agentcore dev\", \"dev server\", \"what port\", \"local development\". Not for adding capabilities to existing projects — use agents-build or agents-connect. Strands vs LangGraph in a migration context routes to agents-build, not here. Connecting to an existing MCP server routes to agents-connect, not here.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2273,2274,2275],{"name":2212,"slug":2213,"type":15},{"name":20,"slug":8,"type":15},{"name":2264,"slug":2265,"type":15},"2026-07-12T08:42:51.963247",{"slug":2278,"name":2278,"fn":2279,"description":2280,"org":2281,"tags":2282,"stars":21,"repoUrl":22,"updatedAt":2289},"agents-harden","harden agents for production","Use when preparing your agent for production — IAM scoping, inbound auth (JWT, SigV4), secrets management, cold start optimization, session lifecycle, rate limiting, input validation, and quota guidance. Triggers on: \"production checklist\", \"harden agent\", \"production ready\", \"secure agent\", \"inbound auth\", \"going live\", \"cold start optimization\", \"session lifecycle\", \"StopRuntimeSession\", \"quota\", \"throttling\", \"maxVms\", \"rate limit\", \"security audit of outbound API calls\", \"gateway target audit for production\", \"restrict who can call\", \"lock down endpoint\", \"only our app can call\". Not for Cedar tool-restriction policies — use agents-connect. Not for quality measurement — use agents-optimize. Not for outbound credential storage or API key wiring — use agents-connect. Not for A2A agent-to-agent auth — use agents-build. Cold start observation and diagnosis (not optimization) routes to agents-debug.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2283,2284,2285,2288],{"name":2212,"slug":2213,"type":15},{"name":20,"slug":8,"type":15},{"name":2286,"slug":2287,"type":15},"Best Practices","best-practices",{"name":13,"slug":14,"type":15},"2026-07-16T06:00:42.174705",{"slug":2291,"name":2291,"fn":2292,"description":2293,"org":2294,"tags":2295,"stars":21,"repoUrl":22,"updatedAt":2305},"agents-optimize","optimize agent quality and performance","Use when measuring or improving agent quality and performance — set up evaluators, online monitoring, CI\u002FCD quality gates, observability, or cost optimization. Triggers on: \"evaluate my agent\", \"add evaluator\", \"measure quality\", \"quality gate\", \"run evals\", \"agent too slow\", \"why is it slow\", \"reduce latency\", \"set up observability\", \"CloudWatch dashboard\", \"how much does my agent cost\", \"cost optimization\", \"logs not showing up\", \"logs missing\", \"spans not found\", \"eval failing\", \"eval error\", \"dev traces\", \"local traces\", \"agentcore dev traces\", \"traces to CloudWatch\". Not for debugging errors or crashes — use agents-debug. Slow but correct routes here; broken routes to debug.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2296,2297,2298,2301,2302],{"name":2212,"slug":2213,"type":15},{"name":20,"slug":8,"type":15},{"name":2299,"slug":2300,"type":15},"Evals","evals",{"name":2249,"slug":2250,"type":15},{"name":2303,"slug":2304,"type":15},"Performance","performance","2026-07-12T08:42:56.488105",114,{"items":2308,"total":2425},[2309,2316,2323,2330,2337,2343,2350,2358,2375,2388,2400,2415],{"slug":2206,"name":2206,"fn":2207,"description":2208,"org":2310,"tags":2311,"stars":21,"repoUrl":22,"updatedAt":2221},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2312,2313,2314,2315],{"name":2212,"slug":2213,"type":15},{"name":2215,"slug":2216,"type":15},{"name":20,"slug":8,"type":15},{"name":2219,"slug":2220,"type":15},{"slug":2223,"name":2223,"fn":2224,"description":2225,"org":2317,"tags":2318,"stars":21,"repoUrl":22,"updatedAt":2236},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2319,2320,2321,2322],{"name":2212,"slug":2213,"type":15},{"name":2230,"slug":2231,"type":15},{"name":2233,"slug":2234,"type":15},{"name":20,"slug":8,"type":15},{"slug":2238,"name":2238,"fn":2239,"description":2240,"org":2324,"tags":2325,"stars":21,"repoUrl":22,"updatedAt":2251},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2326,2327,2328,2329],{"name":2212,"slug":2213,"type":15},{"name":20,"slug":8,"type":15},{"name":2246,"slug":2247,"type":15},{"name":2249,"slug":2250,"type":15},{"slug":2253,"name":2253,"fn":2254,"description":2255,"org":2331,"tags":2332,"stars":21,"repoUrl":22,"updatedAt":2266},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2333,2334,2335,2336],{"name":2212,"slug":2213,"type":15},{"name":20,"slug":8,"type":15},{"name":2261,"slug":2262,"type":15},{"name":2264,"slug":2265,"type":15},{"slug":2268,"name":2268,"fn":2269,"description":2270,"org":2338,"tags":2339,"stars":21,"repoUrl":22,"updatedAt":2276},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2340,2341,2342],{"name":2212,"slug":2213,"type":15},{"name":20,"slug":8,"type":15},{"name":2264,"slug":2265,"type":15},{"slug":2278,"name":2278,"fn":2279,"description":2280,"org":2344,"tags":2345,"stars":21,"repoUrl":22,"updatedAt":2289},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2346,2347,2348,2349],{"name":2212,"slug":2213,"type":15},{"name":20,"slug":8,"type":15},{"name":2286,"slug":2287,"type":15},{"name":13,"slug":14,"type":15},{"slug":2291,"name":2291,"fn":2292,"description":2293,"org":2351,"tags":2352,"stars":21,"repoUrl":22,"updatedAt":2305},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2353,2354,2355,2356,2357],{"name":2212,"slug":2213,"type":15},{"name":20,"slug":8,"type":15},{"name":2299,"slug":2300,"type":15},{"name":2249,"slug":2250,"type":15},{"name":2303,"slug":2304,"type":15},{"slug":2359,"name":2359,"fn":2360,"description":2361,"org":2362,"tags":2363,"stars":21,"repoUrl":22,"updatedAt":2374},"amazon-aurora-mysql","manage Amazon Aurora MySQL clusters","Amazon Aurora MySQL — creates, modifies, and advises on Aurora MySQL clusters specifically (MySQL-compatible engine, Aurora serverless, parallel query). Trigger for Aurora MySQL cluster operations, ACU sizing, I\u002FO-Optimized storage, commitment pricing, or MySQL upgrade planning. Aurora MySQL uses full (VPC-based) configuration — express configuration is PostgreSQL-only. For Aurora PostgreSQL, use amazon-aurora-postgresql instead. Contains safety guardrails and response templates that override defaults.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2364,2365,2368,2371],{"name":20,"slug":8,"type":15},{"name":2366,"slug":2367,"type":15},"Database","database",{"name":2369,"slug":2370,"type":15},"MySQL","mysql",{"name":2372,"slug":2373,"type":15},"Serverless","serverless","2026-07-12T08:43:13.27939",{"slug":2376,"name":2376,"fn":2377,"description":2378,"org":2379,"tags":2380,"stars":21,"repoUrl":22,"updatedAt":2387},"amazon-aurora-postgresql","configure Amazon Aurora PostgreSQL clusters","Amazon Aurora PostgreSQL — creates, modifies, and advises on Aurora PostgreSQL clusters specifically (PostgreSQL-compatible engine, Aurora serverless, express configuration, pgvector, Babelfish). Trigger for Aurora PostgreSQL cluster operations, express-configuration quick-start, ACU sizing, I\u002FO-Optimized storage, commitment pricing, or PostgreSQL upgrade planning. For Aurora MySQL, use amazon-aurora-mysql instead. Contains safety guardrails, express-first routing, and response templates that override defaults.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2381,2382,2383,2386],{"name":20,"slug":8,"type":15},{"name":2366,"slug":2367,"type":15},{"name":2384,"slug":2385,"type":15},"PostgreSQL","postgresql",{"name":2372,"slug":2373,"type":15},"2026-07-16T06:00:34.789624",{"slug":2389,"name":2389,"fn":2390,"description":2391,"org":2392,"tags":2393,"stars":21,"repoUrl":22,"updatedAt":2399},"amazon-bedrock","build generative AI apps with Amazon Bedrock","Builds generative AI applications on Amazon Bedrock. Covers model invocation (Converse API, InvokeModel), RAG with Knowledge Bases, Bedrock Agents, Guardrails, and AgentCore. Use when invoking models, setting up Knowledge Bases, creating agents, applying guardrails, deploying to AgentCore, migrating\u002Fporting\u002Fconverting a Bedrock Agent (including inline agents) to an AgentCore Harness, troubleshooting Bedrock errors (ThrottlingException, AccessDeniedException), or choosing models (Claude, Llama, Nova, Titan). ALSO USE for prompt caching setup and debugging, quota health checks and throttling diagnosis, cost attribution and tracking, migrating between Claude model generations (4.5 to 4.6 to 4.7), chunking strategies, API selection (Converse vs InvokeModel), guardrail capabilities, and model selection. Also covers AgentCore Payments setup (x402, microtransactions, Payment Manager, Connector, Instrument, Coinbase CDP, Stripe Privy, 402 Payment Required, pay for content, paid endpoint, agent payments). NOT for custom model training, Rekognition, or Comprehend.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2394,2395,2396],{"name":2212,"slug":2213,"type":15},{"name":20,"slug":8,"type":15},{"name":2397,"slug":2398,"type":15},"LLM","llm","2026-07-25T05:30:35.20899",{"slug":2401,"name":2401,"fn":2402,"description":2403,"org":2404,"tags":2405,"stars":21,"repoUrl":22,"updatedAt":2414},"amazon-documentdb","manage Amazon DocumentDB clusters","Manages Amazon DocumentDB end-to-end — serverless-on-8.0 cluster setup, TLS\u002FVPC\u002Fdriver config, flexible-schema and vector-search data modeling, MongoDB compatibility assessment, DMS-based migration, slow-query diagnosis, major version upgrades (4.0→5.0→8.0), Well-Architected reviews (41-check wa_review.py), cost estimation, and security hardening. Retrieve for every DocumentDB question and when the user asks to set up or migrate MongoDB to AWS — DocumentDB is AWS's MongoDB-compatible managed database. Triggers: JSON document store, document database, MongoDB on AWS, Nested fields, Lambda cannot connect, TLS handshake, VPC port 27017, IAM auth, Secrets Manager, encryption at rest, $graphLookup, flexible schema, COLLSCAN, compound index, DMS migration, CDC cutover, $vectorSearch, RAG, Global Clusters, DR replication, cost sizing, audit, health check, production-readiness.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2406,2407,2408,2411],{"name":20,"slug":8,"type":15},{"name":2366,"slug":2367,"type":15},{"name":2409,"slug":2410,"type":15},"MongoDB","mongodb",{"name":2412,"slug":2413,"type":15},"NoSQL","nosql","2026-07-12T08:43:00.455878",{"slug":2416,"name":2416,"fn":2417,"description":2418,"org":2419,"tags":2420,"stars":21,"repoUrl":22,"updatedAt":2424},"amazon-dynamodb","design and debug DynamoDB data layers","Designs, reviews, and debugs DynamoDB data layers from design axioms — enumerates access patterns, chooses partition\u002Fsort keys and GSIs, decides single-table vs. multi-table, configures Streams, Global Tables, TTL, and zero-ETL integrations to OpenSearch\u002FRedshift\u002FSageMaker Lakehouse, and produces a defensible data-layer design with a monthly cost estimate and optional live validation. Applies whenever a user is designing, reviewing, or refactoring anything backed by DynamoDB — schemas, access patterns, GSIs, single- vs. multi-table choices, Streams consumers, transactional outboxes, Global Tables, zero-ETL pipelines — even when they don't say \"axioms\" or \"design review.\" Also applies when debugging hot partitions, throttling, unbounded Scans, LWW conflicts, or surprise bills on DynamoDB workloads.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2421,2422,2423],{"name":20,"slug":8,"type":15},{"name":2366,"slug":2367,"type":15},{"name":2412,"slug":2413,"type":15},"2026-07-16T06:00:37.690386",115]