How to scope, store, and revoke the unLocked API key Claude Code uses, so scripts only touch what they need.
TL;DR
Give Claude Code a dedicated, scoped unLocked API key per project, keep it in an environment variable, start read-only, and revoke it when the project ends.
Key Data Points
- unLocked CRM API keys used by Claude Code are scoped and revocable, and should never be pasted into a prompt.
A coding agent can run many actions quickly, so the key matters more than the prompt.
Rules That Keep Scripts Safe
- One key per project. Revoking one never breaks another.
- Start read-only. Add write access only after the output is correct.
- Keep the key out of the prompt. Store it in an environment variable or secret manager.
- Confirm before writes. Have scripts print planned changes and wait for approval.
- Revoke when done. Retire keys for finished projects.
What The Key Cannot Bypass
Plan access, supported actions, and the permissions on the key still apply. Activity history is append-only, so a script cannot rewrite the contact timeline. Customer data is never used to train AI.
Frequently Asked Questions
Can I revoke a key?
Yes. Revoke it in unLocked and any script using it stops working immediately.
Should I share one key across scripts?
No. Use one key per project so you can revoke one without breaking the others.
Where This Fits In unLocked
- best CRM for insurance agents: How insurance CRMs compare on quoting, commissions, AI and price.