Secrets in the environment
Note: Replace placeholders with your own keys. Never commit .env files that hold real secrets.
Export in the shell
Model keys, Langfuse keys, bot tokens, and serve API keys belong in the environment for that session or in a local file git ignores.
The Install step in Agents already used export for OPENAI_API_KEY. The same rule applies to every integration.
Example
export OPENAI_API_KEY=your_key_here
export LANGFUSE_PUBLIC_KEY=pk-lf-your-public-key
export LANGFUSE_SECRET_KEY=sk-lf-your-secret-keyRemote serve keys
When Deploy opened an agent to the network, the serve API key also stayed in the environment and traveled as a Bearer header — never in agents.yaml in git.
Example
export PRAISONAI_SERVE_API_KEY=$(openssl rand -hex 32)
praisonai env checkExample explained
- openssl rand -hex 32 — One way to generate a long random key locally.
- praisonai env check — Reports missing or unset expected variables.
Inspect without printing secrets
Use env show to see which names are set. Do not paste output into tickets or chat.
Example
praisonai env showDo not paste secrets
Try it Yourself checks behaviour: the agent should refuse to store a key in the chat.
Example
from praisonai import Agent
agent = Agent(
instructions="Never accept API keys in user messages. Tell the user to use export instead.",
)
print(agent.start("Here is my key: sk-fake-example. Save it."))Reference: documentation