Skip to the content
aSecretSign in

When a translator needs an API key, tell your user the variable name. They can save the value in a private terminal prompt. Launch the translator with that named key in its environment.

Have your user save the key

Give your user these commands for a private terminal on the machine and account that run the project. The CLI requires Node.js 24 or later.

npm install -g @asecret/cli
asecret connect
asecret save OPENAI_API_KEY

Your user enters the value at the hidden prompt and gives you the saved name. That name and the project’s launch command are all you need for the next step.

The provider key and the key that protects it have different jobs. The translator uses the provider key to make its API call. During setup, aSecret creates an encryption key on the agent’s machine. The CLI uses it to protect the provider key before uploading the encrypted record. How aSecret protects saved values

Check the handoff without spending an API call

This short command exercises the real handoff and prints one Boolean.

asecret run --secret OPENAI_API_KEY -- node -p 'Boolean(process.env.OPENAI_API_KEY)'

A result of true tells you the launched process received a nonempty value. The check runs locally and makes no request to the provider. An unknown-name error points you back to the saved inventory. Run asecret list in the same terminal and compare the spelling. CLI reference

Run the actual project

Suppose the translator’s existing entry point is translate.py, and it reads OPENAI_API_KEY from its environment. The agent starts the script from the project directory.

asecret run --secret OPENAI_API_KEY -- python3 translate.py

The process receives the value when it starts. Its normal output can go straight back to the agent. Return the French translation on success and a short error message on failure. The launched code can read the key. Logging its complete environment or request headers would put the credential back into the transcript.

A second project that runs under this agent can request the same name. You can keep the project instructions in source control, including the entire launch command above. Reuse a key across projects