Add native OpenAI web search research adapter
CI / compose (push) Successful in 11m0s

This commit is contained in:
Marco0300
2026-09-03 20:42:59 +02:00
parent da91c188f3
commit fe3dd338b8
5 changed files with 195 additions and 27 deletions
+17
View File
@@ -17,6 +17,23 @@ After the first successful login, remove both values from `.env`, restart the AP
Copy `.env.example` to an untracked deployment environment file. Production requires a secret-manager supplied `SESSION_SECRET` of at least 32 characters and refuses `AUTOMATED_OUTREACH_ENABLED=true`. Keep bootstrap credentials one-time only; remove and rotate them after provisioning. Never place secrets in images, Compose YAML, logs, backups, or public web roots.
For optional native OpenAI Responses web-search discovery, set these exact server-side variables (and do not use a custom gateway):
```dotenv
AI_RESEARCH_PROVIDER=openai_web_search
AI_RESEARCH_PROVIDER_MODEL=<OpenAI model supporting web search>
AI_RESEARCH_PROVIDER_URL=https://api.openai.com/v1/responses
AI_RESEARCH_PROVIDER_ALLOWED_HOSTS=api.openai.com
OPENAI_API_KEY=<standard OpenAI API key>
```
`OPENAI_API_KEY` is never returned in provider status or logs. The adapter uses
OpenAI's official `web_search` tool, limits the response to 64 KiB and candidates
to 50, accepts only HTTPS URLs from bounded citations/sources, and passes every
candidate through the server's SSRF-safe fetcher. Criteria containing common
prompt-injection instructions are rejected. Anthropic/Google, if approved,
continue using the generic adapter and `AI_RESEARCH_PROVIDER_API_KEY`.
Validate before startup:
```sh