Skip to content
GitHub

Add credentials to a skill

Keep credentials out of the AI loop: never in the repo, never in the agent's context. credbroker resolves them in-process.

Pick a broker, declare the credential in your skill’s SKILL.md, and resolve it in a script with credbroker.

The metadata.auth field in your skill’s SKILL.md names how the credential reaches your script. Pick one of four brokers:

  • env — a plain environment variable, for CI runners and containers.
  • cli — a vendor command that is already signed in, such as gh or aws.
  • creds — a static token you store once, read from your OS keychain. The example below uses it.
  • sso-cookie — a browser session for a corporate single sign-on.

Name the broker and the keys in your skill’s SKILL.md frontmatter:

metadata:
credentialed: true
auth: creds
namespace: your-namespace
keys: ["API_TOKEN"]

The skill declares the key names only. The values never appear in the repository.

Call credbroker from the skill’s scripts/ code, not from the agent:

from credbroker import load_credentials
creds = load_credentials("your-namespace", required_keys=["API_TOKEN"])

The script builds the API request itself. The agent sees the result, not the token.

Say “set up credentials” in your agent. That starts the credential-setup skill from the Credential Brokers pack. It prompts you for each key you declared and stores it in your OS keychain, so you type it once and it stays out of chat.

Corporate SSO cookies, the other brokers, install options, and every lint rule are in the credentialed skill walkthrough. For why the design works this way, read Credentialed skills.