Environment Variables
.env
Some Airalogy Protocol Assigners need environment variables to function—for instance, an external LLM API_KEY or a DATABASE_URL. Place these variables in a .env file at the root of the protocol package:
protocol/
├── protocol.aimd
├── model.py
├── assigner.py
└── .envAPI_KEY=your_api_key
DATABASE_URL=your_database_urlWhen you upload the protocol to the Airalogy platform:
- Security first – the platform deletes the
.envfile from the cloud copy. - Airalogy reads the variables and stores them in the protocol’s Environment settings.
- At runtime, those variables are injected automatically.
.env.example
To help other developers discover the required variables, include an example file:
protocol/
├── protocol.aimd
├── model.py
├── assigner.py
├── .env (ignored after upload)
└── .env.example (retained)API_KEY=your_api_key
DATABASE_URL=your_database_urlThe platform keeps .env.example, so collaborators know which keys to define.
Do Not Use the dotenv Library
In local projects you might load .env via python-dotenv:
from dotenv import load_dotenv
import os
load_dotenv()
API_KEY = os.getenv("API_KEY")This is forbidden on Airalogy—protocols using dotenv will be rejected. Rely on the platform’s automatic injection and fetch values directly:
import os
API_KEY = os.getenv("API_KEY")
DATABASE_URL = os.getenv("DATABASE_URL")Local Testing Options
Shell variables
bashexport API_KEY=your_api_key export DATABASE_URL=your_database_urlThen call
os.getenv()inside Python.Temporary
dotenvUsepython-dotenvduring local development, but remove anydotenvimport before uploading.
By following these guidelines you keep secrets safe while ensuring your protocol runs smoothly both locally and on the Airalogy platform.