Official agent skill

AWS Secrets Manager

by aws in aws/agent-toolkit-for-aws

Secret safety for AWS Secrets Manager, secret management, credentials, API keys, tokens, and passwords.

OfficialApache-2.0Auto-check passedAgent Workflows

Install AWS Secrets Manager

skills CLI
$ npx skills add aws/agent-toolkit-for-aws --skill aws-secrets-manager -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aws/agent-toolkit-for-aws aws-secrets-manager --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aws/agent-toolkit-for-aws.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/aws-core/skills/aws-secrets-manager .claude/skills/aws-secrets-manager && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
aws-secrets-manager
GitHub stars
2.8k
Token cost
~2k tokens
SKILL.md length
826 words
Files
2 (incl. references)
Skills in repo
138
Repo updated
First seen
Licence
Apache-2.0

At a glance

Secret safety for AWS Secrets Manager, secret management, credentials, API keys, tokens, and passwords.

  • Works in 3 steps: MUST NOT call get-secret-value or… → MUST NOT attempt to read secret values… → MUST use {{resolve:secretsmanager:...}}…
  • Tasks that involve Context engineering
  • SKILL.md covers Overview, Rules, The {{resolve:...}} Syntax and Using asm-exec, plus 3 more sections
  • Calls aws; reaches aws-mcp.us-east-1.api.aws; needs AWS_ACCESS_KEY_ID and DB_PASSWORD

What it does

AWS Secrets Manager is an agent skill from aws/agent-toolkit-for-aws, published by the product's own GitHub organization. Secret safety for AWS Secrets Manager, secret management, credentials, API keys, tokens, and passwords. Prevents AI agents from directly fetching secret values and teaches runtime dynamic references with asm-exec so plaintext never enters the LLM context window.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files.

It sits in Agent Workflows, covering Context engineering and Secrets management. It works with Amazon Web Services. The repository describes itself as: Official, AWS-supported MCP servers, skills, and plugins to help AI agents build on AWS. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Context engineering
  • Tasks that involve Secrets management

Example prompts

  • “/aws-secrets-manager”

Requirements

  • Python 3
  • Docker

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. MUST NOT call get-secret-value or batch-get-secret-value -- not via AWS
  2. MUST NOT attempt to read secret values from the Secrets Manager Agent (SMA)
  3. MUST use {{resolve:secretsmanager:...}} references -- these are

What it can do on your machine

Read from SKILL.md and the folder at commit 188af2f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • aws

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • aws-mcp.us-east-1.api.aws

    Also links to:

    • docs.aws.amazon.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • AWS_ACCESS_KEY_ID
    • DB_PASSWORD

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

AWS Secrets Manager loads about 2k tokens when it runs, and up to ~6.5k if it reads all its reference files. Until then it costs about 71 tokens; SKILL.md has 826 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from aws/agent-toolkit-for-aws at commit 188af2f, republished under its Apache-2.0 licence (© aws). 826 words, ~1,993 tokens.

Download SKILL.mdSave it as .claude/skills/aws-secrets-manager/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
aws-secrets-manager
description
Secret safety for AWS Secrets Manager, secret management, credentials, API keys, tokens, and passwords. Prevents AI agents from directly fetching secret values and teaches runtime dynamic references with asm-exec so plaintext never enters the LLM context window.
metadata.version
1

Using Secrets Safely with Agents

Overview

When AI agents handle secrets, credentials, API keys, tokens, or passwords with shell or AWS API access, they can call aws secretsmanager get-secret-value and receive plaintext values in their context window. This creates risk: secrets may leak into logs, conversation history, or downstream tool calls.

This skill teaches a safer pattern: dynamic references resolved at runtime by a wrapper script (asm-exec), so the agent never sees the secret value.

Best-effort defense, not a security boundary. This prevents the most common leakage path but cannot stop all evasion vectors. Combine with IAM least-privilege, CloudTrail monitoring, and VPC endpoint policies.

Rules

You MUST follow these rules when working with secrets:

  1. MUST NOT call get-secret-value or batch-get-secret-value -- not via AWS CLI, SDK, MCP tools, curl, or any other mechanism.
  2. MUST NOT attempt to read secret values from the Secrets Manager Agent (SMA) daemon directly (localhost:2773 or any loopback variant).
  3. MUST use {{resolve:secretsmanager:...}} references -- these are resolved at runtime by asm-exec without exposing values to you.

The {{resolve:...}} Syntax

{{resolve:secretsmanager:<secret-id>:<field-type>:<json-key>:<version-stage>}}
ComponentRequiredDefaultExample
secret-idYes--prod/db-creds or full ARN
field-typeNoSecretStringSecretString
json-keyNo(full value)password
version-stageNoAWSCURRENTAWSPENDING

Using asm-exec

asm-exec is a wrapper that resolves {{resolve:...}} references in command arguments and environment variables, then execs the target command. The secret value exists only in the child process -- never in the agent's context.

Usage
bash
# Pass a database password to psql without exposing it
asm-exec -- psql \
  "host=mydb.example.com \
   user={{resolve:secretsmanager:prod/db-creds:SecretString:username}} \
   password={{resolve:secretsmanager:prod/db-creds:SecretString:password}}" \
  -c "SELECT * FROM users LIMIT 10"

# Use default field-type (SecretString) and full value (no json-key)
asm-exec -- curl -H "Authorization: Bearer {{resolve:secretsmanager:prod/api-token}}" \
  https://api.example.com/data

# Multiple secrets in one command
asm-exec -- mysql \
  -h {{resolve:secretsmanager:prod/mysql:SecretString:host}} \
  -u {{resolve:secretsmanager:prod/mysql:SecretString:username}} \
  -p{{resolve:secretsmanager:prod/mysql:SecretString:password}} \
  -e "SHOW TABLES"
How It Works
  1. Scans all command arguments for {{resolve:...}} patterns
  2. Resolves each reference through the first available backend, in order:
    1. AWS Secrets Manager Agent (SMA) on localhost:2773 (zero-latency, cached)
    2. AWS MCP endpoint (https://aws-mcp.us-east-1.api.aws/mcp), calling the aws___run_script tool over a SigV4-signed request (the tool runs a short server-side Python script that fetches the secret via call_boto3)
    3. Determines the secret's region from an ARN's region segment, or from AWS_REGION / AWS_DEFAULT_REGION, and passes it to the resolver
  3. Substitutes resolved values using re.sub with a callable (single-pass -- prevents re-scan injection if a secret value contains {{resolve:...}})
  4. Runs the target command via subprocess.run -- secret values exist only in the asm-exec process, never in the agent's context window

No local AWS CLI fallback for resolution. asm-exec does not shell out to aws secretsmanager get-secret-value to resolve references. Resolution happens only through SMA or the MCP endpoint, so the plaintext value is never written to a local process's stdout where it could be captured.

SigV4 signing

The MCP endpoint authenticates every tool call with AWS SigV4. asm-exec signs requests itself using only the Python standard library (hashlib/hmac) -- it does not depend on botocore or spin up the mcp-proxy-for-aws-cli proxy, keeping the wrapper a lightweight ephemeral process. The signing service and region are inferred from the endpoint hostname (e.g. aws-mcp.us-east-1.api.aws -> service aws-mcp, region us-east-1); this signing region is independent of the secret's own region, which is passed as the region_name argument to the server-side call_boto3 call.

Credentials for signing are resolved in order: environment variables (AWS_ACCESS_KEY_ID etc.), aws configure export-credentials (AWS CLI v2), then aws configure get (AWS CLI v1).

Show full SKILL.md (324 more words)Show less
Prerequisites

Either backend must be reachable, with credentials that have secretsmanager:GetSecretValue permission:

  • AWS Secrets Manager Agent (SMA) running on localhost:2773, OR
  • AWS credentials resolvable for SigV4 signing of the MCP endpoint (see above). For cross-region secrets, set AWS_REGION (or use a full ARN) so the correct region is targeted.

See SMA setup guide.

Common Patterns

Database connections
bash
asm-exec -- psql "postgresql://{{resolve:secretsmanager:prod/db:SecretString:username}}:{{resolve:secretsmanager:prod/db:SecretString:password}}@db.example.com:5432/mydb"
Docker with secrets
bash
asm-exec -- docker run -e "DB_PASSWORD={{resolve:secretsmanager:prod/db:SecretString:password}}" myapp:latest
Configuration file templating
bash
# Generate config with resolved secrets, write to file
asm-exec -- sh -c 'echo "password={{resolve:secretsmanager:app/db:SecretString:password}}" > /tmp/app.conf'

Structural Enforcement (Plugin Hook)

When the aws-core plugin is enabled, a PreToolUse hook automatically blocks any attempt to call get-secret-value or batch-get-secret-value -- via AWS CLI, MCP tools, or direct SMA access. No manual configuration needed.

The hook is defined at plugins/aws-core/com.anthropic.claude-code/hooks/hooks.json and activates automatically when the plugin is installed.

Troubleshooting

"Secret not found" errors

Verify the secret exists and your IAM role has secretsmanager:GetSecretValue permission. Check the secret name matches exactly (case-sensitive).

SMA connection refused

The Secrets Manager Agent may not be running. This is non-fatal: asm-exec falls through to the SigV4-signed MCP endpoint. Ensure AWS credentials are resolvable (see SigV4 signing above) so that backend can authenticate.

"Failed to resolve" errors

Both backends were unreachable or returned no value. When MCP resolution fails, asm-exec prints the specific cause to stderr (asm-exec: MCP resolution failed: ...) -- a timeout, an unreachable endpoint, an HTTP status, a denied permission, or a missing value -- so read that line first. Check that either SMA is running or AWS credentials are valid (aws sts get-caller-identity), that the secret's region is correct (set AWS_REGION or use a full ARN), and that your identity has secretsmanager:GetSecretValue on the secret. A 401 from the MCP endpoint indicates a SigV4 signing or credential problem, not a missing secret. If the failure is a timeout, the server-side call may need longer than the default 30s -- raise it with ASM_EXEC_MCP_TIMEOUT (seconds).

Resolution produces empty string

The JSON key may not exist in the secret value. Verify the secret structure in the AWS Console or ask the secret owner to confirm the available keys.

© aws, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in plugins/aws-core/skills/aws-secrets-manager of aws/agent-toolkit-for-aws.

  • SKILL.md
  • references/asm-exec

Open the folder on GitHubat commit 188af2f

Compare with similar skills

AWS Secrets Manager next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

AWS Secrets Manager compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
AWS Secrets Manager this skillaws/agent-toolkit-for-aws2.8k—~2kAutomated safety check: PassApache-2.0
Audit Env Variablesqdhenry/Claude-Command-Suite1.3k—~2.8kAutomated safety check: NotesNone
Hashicorp VaultBagelHole/DevOps-Security-Agent-Skills1.1k—~2kAutomated safety check: PassMIT
Secrets Managementdavila7/claude-code-templates32k12 repos~2kAutomated safety check: PassMIT
Secrets Vault Manageralirezarezvani/claude-skills28k1 repos~3.6kAutomated safety check: NotesMIT
Deploying Cloud Deception With Decoy Resourcesmukul975/Anthropic-Cybersecurity-Skills34k—~2.8kAutomated safety check: PassApache-2.0

Similar skills

  • Audit Env Variables

    qdhenry/Claude-Command-Suite

    Analyze environment variables in JavaScript/TypeScript projects.

    1.3k GitHub stars~2.8k tokensUpdated 7 mo ago
    DevOps & CloudAuto-check: notes
  • Hashicorp Vault

    BagelHole/DevOps-Security-Agent-Skills

    Manage secrets and PKI with HashiCorp Vault. An agent skill from BagelHole/DevOps-Security-Agent-Skills.

    1.1k GitHub stars~2k tokensUpdated 4 mo ago
    DevOps & CloudAuto-check passed
  • Secrets Management

    davila7/claude-code-templates

    Secure secrets management practices for CI/CD pipelines using Vault, AWS Secrets Manager, and other tools.

    32k GitHub starsUsed in 12 repos~2k tokens
    DevOps & CloudAuto-check passed
  • Secrets Vault Manager

    alirezarezvani/claude-skills

    A skill your agent uses when the user asks to set up secret management infrastructure, integrate HashiCorp Vault, configure cloud secret stores (AWS Secrets Manager, Azure Key Vault, GCP Secret…

    28k GitHub starsUsed in 1 repo~3.6k tokens
    DevOps & CloudAuto-check: notes
  • Deploying Cloud Deception With Decoy Resources

    mukul975/Anthropic-Cybersecurity-Skills

    Deploy cloud-native deception across AWS, Azure, and GCP using decoy (honey) resources whose only purpose is to generate a high-fidelity alert the instant an attacker touches them: canary IAM access…

    34k GitHub stars~2.8k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Secret Scanner

    alirezarezvani/claude-code-tresor

    Detect exposed secrets, API keys, credentials, and tokens in code.

    777 GitHub stars~1.4k tokensUpdated 3 mo ago
    DevelopmentAuto-check: warnings

More from aws/agent-toolkit-for-aws

All 138 skills in this repo
  • Agent Advisor

    aws/agent-toolkit-for-aws

    Official

    Entry point for AI-agent work on AWS: pick a runtime, plan a migration for existing workloads, and build an executable POC — one phased flow.

    2.8k GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Agents Build

    aws/agent-toolkit-for-aws

    Official

    A skill your agent uses to extend an existing agent project with memory, app integration, VPC, multi-agent, migration, model, browser, code interpreter, payments, or resource removal.

    2.8k GitHub stars~2.3k tokensUpdated today
    Auto-check: notes
  • Launch With AWS

    aws/agent-toolkit-for-aws

    Official

    Migrates vibe-coded web applications to AWS. An agent skill from aws/agent-toolkit-for-aws.

    2.8k GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Official

    Deploy an event-driven workflow that routes S3 uploads to either Lambda or Fargate via Step Functions based on file size.

    2.8k GitHub stars~4k tokensUpdated today
    Auto-check passed
  • AWS Marketplace Metering

    aws/agent-toolkit-for-aws

    Official

    Deploys, queries, and debugs AWS Marketplace usage-based (PAYG) metering — the pipeline (ResolveCustomer, BatchMeterUsage, EventBridge via SAM) and querying/debugging metering records, statuses…

    2.8k GitHub stars~18k tokensUpdated today
    Auto-check passed
  • Agents Pay

    aws/agent-toolkit-for-aws

    Official

    A skill your agent uses when THIS agent needs to pay for x402-protected content at runtime: hitting a paywall mid-task, settling it via AgentCore Payments, and applying operator-defined spend limits.

    2.8k GitHub stars~6.5k tokensUpdated today
    Auto-check: notes

Questions about AWS Secrets Manager

What does AWS Secrets Manager do?

Secret safety for AWS Secrets Manager, secret management, credentials, API keys, tokens, and passwords. AWS Secrets Manager is an agent skill from aws/agent-toolkit-for-aws, published by the product's own GitHub organization. Secret safety for AWS Secrets Manager, secret management, credentials, API keys, tokens, and passwords.

When should I use AWS Secrets Manager?

AWS Secrets Manager fits situations like: tasks that involve Context engineering; tasks that involve Secrets management.

How do I install AWS Secrets Manager in Claude Code?

Run `npx skills add aws/agent-toolkit-for-aws --skill aws-secrets-manager -a claude-code`. Or copy the skill folder (plugins/aws-core/skills/aws-secrets-manager in aws/agent-toolkit-for-aws) into .claude/skills/aws-secrets-manager in your project. Claude Code loads it when a task matches its description.

How do I install AWS Secrets Manager in Codex?

Run `npx skills add aws/agent-toolkit-for-aws --skill aws-secrets-manager -a codex`. Or copy the skill folder (plugins/aws-core/skills/aws-secrets-manager in aws/agent-toolkit-for-aws) into .agents/skills/aws-secrets-manager in your project. Codex loads it when a task matches its description.

Can I use AWS Secrets Manager in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aws/agent-toolkit-for-aws --skill aws-secrets-manager -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/aws-secrets-manager, .gemini/skills/aws-secrets-manager, .github/skills/aws-secrets-manager and .opencode/skills/aws-secrets-manager in your project.

What does AWS Secrets Manager need to run?

Going by SKILL.md and its folder, AWS Secrets Manager needs the command-line tools its instructions call (aws) and credentials named AWS_ACCESS_KEY_ID and DB_PASSWORD. Our summary lists: Python 3; Docker.

Does AWS Secrets Manager access the network?

SKILL.md names 2 domains. In commands or code: aws-mcp.us-east-1.api.aws; the agent is likely to contact it when it follows the instructions. As links in the text: docs.aws.amazon.com. This is read from the text; nothing was executed.

Is AWS Secrets Manager safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does AWS Secrets Manager use?

AWS Secrets Manager is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does AWS Secrets Manager use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.5k tokens, read only when the agent opens those files.

What are the alternatives to AWS Secrets Manager?

Skills that share tags, products or a category with AWS Secrets Manager: Audit Env Variables (qdhenry/Claude-Command-Suite, 1.3k stars), Hashicorp Vault (BagelHole/DevOps-Security-Agent-Skills, 1.1k stars), Secrets Management (davila7/claude-code-templates, 32k stars) and Secrets Vault Manager (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains AWS Secrets Manager?

aws (a GitHub organization, an official publisher) maintains it in aws/agent-toolkit-for-aws, which has 2,825 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on October 7, 2026.

Source: aws/agent-toolkit-for-aws on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.