Agentic-AFL reads all sensitive and deployment-specific settings from environment variables, keeping secrets and infrastructure addresses out of source code entirely. If aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AdithyaaSivamal/Agentic-AFL/llms.txt
Use this file to discover all available pages before exploring further.
.env file is present at the project root, python-dotenv loads it before any field in AgenticAFLConfig is evaluated. Explicit environment variable exports set in the shell always take priority over .env values — python-dotenv deliberately does not overwrite variables that are already present in os.environ. This means you can commit a .env with safe development defaults and override individual keys in CI or production without modifying the file.
.env Template
Copy this template to the project root, fill in your values, and Agentic-AFL will pick them up automatically on the next start..env
Full Reference Table
| Environment Variable | settings field | Default | Description |
|---|---|---|---|
LLM_API_PROVIDER | llm_api_provider | openai | LLM backend: openai, gemini, or local |
LLM_API_KEY | llm_api_key | (empty) | OpenAI API key |
GEMINI_API_KEY | gemini_api_key | (empty) | Google Gemini API key |
LLM_MODEL_NAME | llm_model_name | gpt-4.1-2025-04-14 | Model identifier passed to the provider API |
GHIDRA_INSTALL_DIR | ghidra_install_dir | /opt/ghidra | Path to Ghidra installation directory |
GHIDRA_PROJECT_DIR | ghidra_project_dir | /tmp/ghidra_projects | Ghidra headless project storage directory |
POSTGRES_DSN | postgres_dsn | postgresql://agentic_afl:agentic_afl@localhost:5432/agentic_afl | PostgreSQL connection string |
AFL_OUTPUT_DIR | afl_output_dir | ./afl_output | AFL++ campaign output directory |
AFL_SYNC_DIR | afl_sync_dir | ./afl_output/sync_dir | Sync directory for solved payload injection |
MIN_STALL_TIME_SECONDS | min_stall_time_seconds | 0 | Seconds without new edges before stall; 0 uses cycle-based detection |
Z3_TIMEOUT_SECONDS | z3_timeout_seconds | 5 | Hard timeout for each Z3 s.check() call |
Z3_SANDBOX_DIR | z3_sandbox_dir | /tmp/agentic_afl_sandbox | Temp directory for Z3 subprocess files |
K_VOTE_COUNT | k_vote_count | 3 | Number of Z3 scripts generated per stall for K-way voting |
LOG_LEVEL | log_level | INFO | Python logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) |
LOG_DIR | log_dir | ./logs | Directory for structured log output files |
DEBUG_MODE | debug_mode | false | Set to 1, true, or yes to save raw LLM completions and Z3 scripts to /tmp/agentic_afl_debug/ |
LLM Provider Configuration
Agentic-AFL supports three LLM backends. TheLLM_API_PROVIDER variable selects which client is instantiated at startup; the remaining LLM variables are forwarded to that client only.
OpenAI (default)
Switching to Google Gemini
llm_max_output_tokens. The default of 16384 is sufficient for most Z3 scripts, but raise it if you observe truncated outputs on complex constraint systems.
Local / Self-hosted
local is selected, Agentic-AFL routes requests to a locally running inference server (for example, Ollama or vLLM). No API key is required. Ensure the server is reachable and the model name exactly matches what the server exposes.
PostgreSQL Setup
Agentic-AFL uses PostgreSQL as its spec store and CARM (Constraint-Aware Retrieval Module) backend. A customjaccard_similarity() SQL function computes tag-set similarity server-side, making CARM queries efficient even on large template collections.
Starting PostgreSQL with Docker
The quickest way to spin up a compatible instance during development is the official PostgreSQL Docker image:POSTGRES_DSN exactly, so no further configuration is needed for a local development setup.
Applying the Schema
Once the container is running, apply the initialization schema from the repository:init.sql script creates the constraint_templates table, the JSONB indexes, and the jaccard_similarity() function that CARM queries rely on. The schema must be applied before Agentic-AFL’s first run; subsequent runs are idempotent.
Connecting to a Remote or Managed Database
OverridePOSTGRES_DSN with any valid libpq connection string to point Agentic-AFL at a remote or managed PostgreSQL instance (for example, Amazon RDS or Cloud SQL):
python-dotenv is an optional dependency. If it is not installed in your environment, Agentic-AFL silently skips .env file loading and falls back to plain os.environ. All environment variables set directly in the shell or in your container runtime’s environment still work exactly as documented — no .env file is required.