---
id: ask-credential-switching
track: coding
version: 0.0.5
label: blocks
keyword: block
where: command
sha256: 28d85889796c2523766518aa638bba4bde443a9feddbe7d8234ff1b3bb6318a8
source: https://github.com/open-coder-ai/chock-catalog/tree/1e60d211c1bb767152c6ab0167932da06ab3a10f/base/ask-credential-switching
catalog_ref: 1e60d211c1bb767152c6ab0167932da06ab3a10f
---

# Review Cloud Identity Switches

ask-credential-switching · version 0.0.5

Blocks — Refuses a matched shell command before it runs. Chock adds friction. It is not a security boundary. 

In a git repo: in agent (The agent's hooks check this once chock sync sets them up. If the hook crashes, the action goes through.)



## What it does

Best effort, ask only. Asks a person before a shell command switches the identity later commands act as: aws --profile, AWS_PROFILE= or AWS keys (also $env:), sts assume-role, configure set of a key; gcloud account, configuration, login or impersonation; az account set, az login as a principal or identity; kubectl use-context or set-credentials; writes to ~/.aws, ~/.config/gcloud, ~/.azure. Names in .chock/credential-allowlist.json pass. Misses: scripts, SDKs, env files, credential_process.

## Its label on each agent

- Claude Code (tested): Blocks — Refuses a matched shell command before it runs. Builder: /coding/builder/#client=claude-code&p=ask-credential-switching
- Cursor (tested): Asks — Asks before a matched shell command runs. Builder: /coding/builder/#client=cursor&p=ask-credential-switching
- Codex (tested): Advisory — Not enforced (this client cannot prompt before a shell command). Builder: /coding/builder/#client=codex&p=ask-credential-switching
- GitHub Copilot (tested): Asks — Asks before a matched shell command runs in VS Code. Not enforced in Copilot CLI, because it cannot prompt there. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run). Builder: /coding/builder/#client=copilot&p=ask-credential-switching
- Devin (tested): Advisory — Not enforced (this client cannot prompt before a shell command). Builder: /coding/builder/#client=devin&p=ask-credential-switching
- Grok (tested): Not graded yet for Grok. Builder: /coding/builder/#client=grok&p=ask-credential-switching
- goose (tested): Not graded yet for goose. Builder: /coding/builder/#client=goose&p=ask-credential-switching
- Antigravity (tested): Not graded yet for Antigravity. Builder: /coding/builder/#client=antigravity&p=ask-credential-switching
- OpenHands (untested): Not graded yet for OpenHands. Builder: /coding/builder/#client=openhands&p=ask-credential-switching
- Kimi Code (untested): Not graded yet for Kimi Code. Builder: /coding/builder/#client=kimi-code&p=ask-credential-switching
- Factory Droid (untested): Not graded yet for Factory Droid. Builder: /coding/builder/#client=factory-droid&p=ask-credential-switching

## What it misses

Scripts, SDKs, env files, credential_process.

## Examples

- Asks: A request lists a bucket as another AWS profile. — `aws s3 ls --profile prod`
- Allowed: A request lists a bucket with the default identity. — `aws s3 ls`

## Latest change

0.0.5 · 2026-10-27 — Title wording only (IR-F40): "Ask Credential Switching" is now "Review Cloud Identity Switches". The id, guard and tests are unchanged.

## Provenance

- Tested by 65 of 65 cases run automatically
- SHA-256: `28d85889796c2523766518aa638bba4bde443a9feddbe7d8234ff1b3bb6318a8`
- Catalog commit: https://github.com/open-coder-ai/chock-catalog/commit/1e60d211c1bb767152c6ab0167932da06ab3a10f
- Source: https://github.com/open-coder-ai/chock-catalog/tree/1e60d211c1bb767152c6ab0167932da06ab3a10f/base/ask-credential-switching (catalog path `base/ask-credential-switching`)
- Presets: none
- JSON: `/api/coding/policies/ask-credential-switching.json`
- Report a problem: https://chock.sh/report/?policy=ask-credential-switching&version=0.0.5&page=%2Fcoding%2Fpolicies%2Fask-credential-switching%2F
