Repository navigation
Concept Credential Hygiene
Credential hygiene is constitution principle P11. The project must use temporary, least-privilege credentials and must not write secrets into source, disk config, chat, issues, or pull request transcripts.
The constitution's local AWS access rule is that developer credentials must be temporary and supplied through environment variables only. Long-lived IAM user access keys must not be written to disk or committed.
The mechanism is preference-ordered rather than fixed:
- AWS CloudShell session export from a least-privilege console user with no access keys.
-
sts:AssumeRoleinto a task-scoped role, with any bootstrap key held only in environment variables and deleted immediately after use. - IAM Identity Center, preferred on accounts that already belong to an AWS Organization.
The constitution explicitly avoids mandating IAM Identity Center for every account because using it for AWS-account access can require an organization instance, and creating an AWS Organization on the free plan would conflict with Concept-Budget-Ceiling.
Spend-bearing runtime access must be tied to a verified, allowlisted sign-in
identity, consistent with Concept-IP-And-Legal-Posture. If a browser needs
AWS credentials, they must be temporary and scoped to that identity's permitted
actions; server-side callers use least-privilege IAM roles. Unauthenticated
guest credentials must not grant spend-bearing access. This is a v1.5.0
requirement, not yet implemented: CognitoStack still creates an
unauthenticated identity pool.
IAM permissions must be least-privilege, scoped by action and, where supported,
by aws:RequestedRegion and service conditions. This applies to runtime roles
and to build-time or one-shot asset-generation identities.
Correction, 2026-11-07: AWS's Polly service authorization reference supports
no polly:Engine or polly:VoiceId condition keys. P11 cites them as examples,
but its where supported qualification governs. Region-scope the synthesis
grant and treat voice/engine as application settings, not IAM restrictions.
The constitution was not amended. Source-Amazon-Polly records the primary
source and the disagreement with the frozen spec 001 policy example.
Application secrets, such as API keys, belong in SSM SecureString or environment variables, never in source.
For code and docs:
- Do not paste credentials, account IDs, secret-bearing endpoints, or ARNs with account IDs into the wiki.
- Do not add examples that normalize storing AWS credentials on disk.
- Do not broaden IAM permissions for convenience without documenting why.
- Do not hide credential failures behind silent fallbacks.
- Treat each Strands tool as code running with the host process's permissions. Audit its filesystem, network, and shell behavior before attaching it to an agent. See Component-Agent-Runtime and Source-Strands-Harness-SDK-Docs.
Credential hygiene applies to examples, scripts, logs, and wiki pages:
- Use placeholders that cannot be mistaken for real values.
- Prefer role names and policy intent over full resource identifiers when an identifier would reveal account-specific data.
- Redact command output before pasting it into issues or docs.
- Keep temporary credentials out of shell history where possible.
- Treat build-time asset generation with the same care as runtime access.
If a task cannot be completed without exposing a credential or account-specific secret, stop the task and change the workflow. Do not work around the rule.
This page pairs with Concept-Supply-Chain-Discipline because secret safety and dependency safety are the two main substitutes for a dedicated security team.
A short-term Bedrock API key is a convenient temporary credential for one-off probes, but it changes more than it looks. Verified 2026-10-29 during spec 003's spike S0, against the pinned AWS SDK for JavaScript v3:
-
Setting
AWS_BEARER_TOKEN_BEDROCKswitches every Bedrock client to API-key auth.@aws-sdk/coresets the auth-scheme preference tohttpBearerAuthwhenever the variable exists, so calls you meant to sign with SigV4 use the key instead. Other services, Polly for example, still use the exported IAM credentials. -
Bearer calls need their own IAM action:
bedrock:CallWithBearerToken, andbedrock-mantle:CallWithBearerTokenfor the mantle endpoint. Without it, every call fails with an IAM denial before any plan or model check, which proves nothing about the plan or the model. - A short-term key carries the permissions of whoever generated it, for at most 12 hours and only in that Region (AWS "How Amazon Bedrock API keys work"). Generate it as the least-privilege identity, and make it again after changing that identity's policy.
-
The mantle endpoint rejects a request that sends the key in both
Authorizationandx-api-key(HTTP 401). Send it only asAuthorization: Bearer.
Clear the variable when the probe is done, as with any temporary credential.
See also: Source-Constitution, Concept-Supply-Chain-Discipline.
- Concept-Cloud-Only-Inference
- Concept-Budget-Ceiling
- Concept-Personality-Gate
- Concept-IP-And-Legal-Posture
- Concept-Supply-Chain-Discipline
- Concept-Graceful-Degradation
- Concept-Observability
- Concept-Testing-And-TDD
- Concept-Credential-Hygiene
Editing in the browser? Wiki edits are live and bypass wiki:lint. Read
Guide-Wiki-Contributing first.