sk

AI Agent Security Checklist

A short, printable runbook for daily use.

Before you run

During execution

Before merge/release

Emergency response

Do / Don’t quick table

Do Don’t
Inject secrets at runtime with stdin/env Paste secrets directly into prompts
Use separate keys per environment Reuse one key across dev/stage/prod
Rotate credentials on schedule Keep long-lived tokens forever
Redact logs/traces before sharing Publish raw traces with sensitive fields
Revoke immediately on suspicion Wait for full incident analysis first

Copy/paste secure setup snippets

Local shell (zsh/bash)

# Store once (stdin avoids shell history leaks)
printf '%s' "$OPENAI_API_KEY" | sk add -k OPENAI_API_KEY --stdin --force

# Load only in the active process/session
export OPENAI_API_KEY="$(sk get -k OPENAI_API_KEY)"

# Optional cleanup when done
unset OPENAI_API_KEY

CI job pattern (GitHub Actions)

- name: Load runtime secret from sk
  run: |
    export OPENAI_API_KEY="$(sk get -k OPENAI_API_KEY)"
    your_command_here

Rotation helper

printf '%s' "$NEW_OPENAI_API_KEY" | sk add -k OPENAI_API_KEY --stdin --force