Hf Cloud AWS Context Discovery
Hugging FaceOfficialPublished by Hugging Face
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a standardized procedure for agents to discover and validate the user's AWS environment. By programmatically checking the active profile, region, and caller identity, it ensures that subsequent AWS tasks are performed in the correct context. It specifically identifies SSO-authenticated principals to proactively warn users about potential IAM permission limitations, preventing common deployment failures.
What it does
- Resolves the active AWS profile and region using environment variables and local configuration files.
- Validates AWS credentials and retrieves the account ID and caller ARN.
- Identifies the authentication method, specifically flagging SSO-assumed roles.
- Provides a concise summary of the current AWS context to the user.
- Stops execution if credentials are invalid or configuration is missing.
When to use it
- At the very beginning of any interaction involving AWS services.
- Before running any AWS CLI or SDK commands.
- When a user requests deployment or resource creation without specifying a profile or region.
- Whenever the agent needs to confirm the user's current IAM permissions.
Advantages
- Prevents errors by verifying configuration before attempting operations.
- Proactively identifies SSO limitations to avoid mid-deployment failures.
- Eliminates guesswork regarding region and profile settings.
- Provides clear, actionable feedback on the current environment status.
Usage examples
- “Deploy my model to SageMaker.”
- The agent runs the discovery routine, confirms the account and region, warns the user if they are using SSO, and then proceeds with the deployment.
- “List my S3 buckets.”
- The agent identifies the active profile and region, validates the credentials, and then lists the buckets in the correct account.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/huggingface/hf-cloud-aws-context-discovery/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip hf-cloud-aws-context-discovery.zip -d .agents/skills
Documentation by Hugging Face
AWS Context Discovery
Before doing any AWS work, read the user's local AWS config. Don't guess the region, and don't ask the user for things their config already answers.
What to discover
Run these at the start of the AWS work and remember the results for the rest of the session.
1. Active profile
AWS_PROFILE env var, else default. If the user mentioned a profile in their prompt, that overrides. If the named profile doesn't exist in ~/.aws/config, surface that clearly.
2. Region
Resolution order — stop at the first one that produces a value:
Region the user explicitly named in this conversation
AWS_REGIONenv varAWS_DEFAULT_REGIONenv varregionfield on the active profile in~/.aws/configAsk the user — but only after the first four have failed
Do not fall back to us-east-1 or any other hardcoded default.
3. Credentials, account ID, caller ARN
aws sts get-caller-identity --profile <profile> --region <region>Three purposes in one call: confirms credentials are valid (stop if not), returns the Account ID (needed for ARN construction), returns the Arn of the caller.
4. Identify SSO / assumed-role principals
The Arn field tells you what kind of principal this is. The pattern matters because it determines what IAM operations the caller can do.
| ARN pattern | Type | IAM write capability |
|---|---|---|
arn:aws:iam::<acct>:user/<name> | IAM user | Depends on attached policies |
arn:aws:sts::<acct>:assumed-role/AWSReservedSSO_<...>/<email> | SSO assumed-role | Typically none — can't create/modify IAM roles |
arn:aws:sts::<acct>:assumed-role/<role>/<session> | Regular assumed-role | Depends on the role |
If the caller is SSO, surface this immediately before later skills hit iam:CreateRole and fail:
Heads up: you're authenticated via SSO (
AWSReservedSSO_<PermissionSet>_...). SSO principals usually can't create IAM roles directly. If we need a SageMaker execution role, I'll look for an existing one first — if none exists, you'll need to ask whoever manages your AWS access to create one.
This is the highest-leverage thing this skill does. Surfacing it now turns a confusing mid-deployment error into a five-second conversation.
Commands to run
# Effective profile and region (faster than parsing config files)
aws configure list
# Validate credentials and get identity
aws sts get-caller-identity
aws sts get-caller-identity --profile <profile-name> # if a profile was namedaws configure list handles env-var overrides and shows the resolved effective values. Prefer it over parsing ~/.aws/config yourself. If you need to read raw config (e.g. to list profiles), ~/.aws/config and ~/.aws/credentials are plain INI files — read-only.
What to report back
One or two lines, not a wall of text:
Working with profile
my-profileineu-west-1, account123456789012. You're authenticated via SSO, so we'll need to use an existing IAM role rather than create one.
Don't ask the user to confirm the region you just read from their config — they configured it; that is the confirmation.
If something is wrong (credentials expired, profile doesn't exist, no region anywhere), stop and surface the specific error before continuing.
Files
- ATTRIBUTION.mdAdded by AutoGineer904 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md3.9 KiB
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs a command-line tool
Security
What our scanner noticed· Medium risk
- References to credential files
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Hugging Face
- Publisher
- Hugging Face (Official)
- Source
- huggingface/skills · skills/hf-cloud-aws-context-discovery · commit 25910b3
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Hugging Face.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download hf-cloud-aws-context-discovery.zip