Skip to main content

Configuration

Environment Variables​

VariableRequiredPurpose
TELEGRAM_BOT_TOKENYesAuthenticates the Telegram bot used by aiogram.
TELEGRAM_ALLOWED_CHAT_IDSRecommendedComma-separated numeric chat IDs allowed to use the bot. Without it, every chat is refused.
TELEGRAM_CHAT_IDLegacyRead as a fallback when TELEGRAM_ALLOWED_CHAT_IDS is unset.
AI_PROVIDERNoProvider preset. Defaults to ollama.
AI_MODELProvider-dependentModel identifier. Defaults to qwen3:8b with Ollama.
AI_BASE_URLProvider-dependentOpenAI-compatible chat-completions endpoint.
AI_API_KEYProvider-dependentCredential for providers that require authentication.
AI_TEMPERATURENoSampling temperature; defaults to 0. Must be numeric.
AI_TIMEOUT_SECONDSNoProvider request timeout in seconds; defaults to 300. Must be greater than zero.
GEMINI_API_KEYNoEnables automatic Gemini fallback when the primary provider fails. Also used as the API key when AI_PROVIDER=gemini.
GEMINI_MODELNoFallback model; defaults to gemini-3.5-flash-lite.
GEMINI_BASE_URLNoOverrides the Gemini OpenAI-compatible endpoint.

Create a local configuration from the example:

cp .env.example .env

Do not commit real values. The repository .gitignore excludes .env, but contributors must still review commits and logs for accidental secrets.

AI Providers​

Lophiarch uses one OpenAI-compatible provider interface across local and hosted models.

AI_PROVIDERDefault endpointDefault modelAPI keyNotes
ollamahttp://localhost:11434/v1/chat/completionsqwen3:8bNot requiredDefault configuration.
vllmhttp://localhost:8000/v1/chat/completionsQwen/Qwen3-8BNot required by default
lmstudiohttp://localhost:1234/v1/chat/completionslocal-modelNot required by default
llamacpphttp://localhost:8080/v1/chat/completionslocal-modelNot required by default
geminihttps://generativelanguage.googleapis.com/v1beta/openai/chat/completionsgemini-3.5-flash-liteRequiredUses AI_API_KEY, or GEMINI_API_KEY when that is empty.
openai-compatibleSet with AI_BASE_URLSet with AI_MODELProvider-dependentBoth endpoint and model are required.

A local default configuration:

AI_PROVIDER=ollama
AI_MODEL=qwen3:8b
AI_BASE_URL=http://localhost:11434/v1/chat/completions
AI_API_KEY=
AI_TEMPERATURE=0
AI_TIMEOUT_SECONDS=300

For an unlisted service, use AI_PROVIDER=openai-compatible and supply its chat-completions URL, model identifier, and API key when required.

Gemini Fallback​

Setting GEMINI_API_KEY while the primary provider is anything other than gemini enables automatic failover. Lophiarch calls Gemini only when the primary provider cannot connect, times out, returns an HTTP error, or produces an invalid chat-completions response. When the primary provider is healthy, no prompt or tool schema is sent to Gemini.

GEMINI_API_KEY=your-google-ai-studio-key
GEMINI_MODEL=gemini-3.5-flash-lite

Two special cases:

  • If AI_PROVIDER=openai-compatible and AI_BASE_URL or AI_MODEL is missing, Lophiarch starts with Gemini directly when the fallback key exists.
  • Remove GEMINI_API_KEY to guarantee local-only inference.

Fallback changes only model transport. Authorization, scope validation, tool policy, and MCP execution stay enforced by the same runtime.

See Local and Self-Hosted AI Providers for provider-specific commands.

Runtime Policy​

src/config/agent-policy.yaml controls which tools may run and what they require. The shipped policy denies unknown tools and requires a declared scope for every active scanner.

authorization:
default_deny: true
require_declared_scope: true

allowed_tools:
- name: execute_nmap
requires_approval: true
target_fields: [target]

forbidden_tools:
- exploit_target
- establish_persistence
- dump_credentials
- destructive_test

Review this file before deploying a modified image. It is read at runtime, so a policy edit requires a bot restart. See Authorization and Scope.

Worker Image Names​

The current scanner modules expect these exact tags:

CapabilityImage
Nmaplophiarch-nmap:latest
Ffuflophiarch-ffuf:latest
Nucleilophiarch-nuclei:latest
Subfinderprojectdiscovery/subfinder:latest
dnsxprojectdiscovery/dnsx:latest

If a custom build uses different names, update the corresponding engine module or retag the image.

Nmap Modes​

ModeCurrent behavior
quickAdds -F for the common-port set.
defaultUses service detection with -sV -Pn.
deepAdds all-port scanning and default scripts with -p- -sC.

All modes request XML output for parsing.

Ffuf Modes​

ModeWordlist
quick or default/wordlists/quick.txt
deep/wordlists/deep.txt

The custom image downloads its wordlists from SecLists during image build. deep is also the tool default when no mode is supplied.

Helm Values​

The chart exposes provider-neutral values:

telegram:
botToken: ""
allowedChatIds: ""

ai:
provider: ollama
model: qwen3:8b
baseUrl: http://ollama.default.svc.cluster.local:11434/v1/chat/completions
temperature: "0"
timeoutSeconds: "300"
apiKey: ""
geminiApiKey: ""

dockerSocket:
groupId: 999

A non-empty geminiApiKey enables the same automatic failover described above. Override secrets at installation time or through a secure values workflow. Avoid committing plaintext production values.

Generated Reports​

PDFs are created in generated_reports/. The directory is ignored by Git and uses Lophiarch_Report_<timestamp>.pdf filenames. Inside a disposable main container, reports disappear when the container is removed unless a volume is mounted.