AG-CORS: Agent HTTP Server: Wildcard CORS Origin
What this rule means
The agent's HTTP server sets `allow_origins=["*"]`. For a regular API this enables data theft; for an agent API it lets any website a logged-in user visits invoke the agent's tools — code execution, file access, data exfiltration — on that user's behalf.
Why it matters
LangServe and AutoGen ship `allow_origins=["*"]` in their official example servers, and developers copy the example into production unchanged.
How to fix it
Replace the wildcard with an explicit origin allowlist, and add authentication — open CORS with no auth means anyone can invoke the agent directly.
Detect it
pip install lucin
lucin scan . # all rules
lucin explain AG-CORS # this rule, in your terminal
Findings carry a file:line and, where the rule supports it, a witness
path showing the flow that triggered it. Precision and recall for the whole rule set,
with the commands that regenerate them, are on the
benchmarks page — and the gaps are on
limits.