Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.
Python agentic-aiai-securityalert-triageblue-teamcybersecuritydetection-engineeringincident-responselanggraphllm-agentsmcpmitre-attackmodel-context-protocolpurple-teamsecurity-operationsself-hostedsiemsoarsocthreat-detectionthreat-intelligence
An exception message is the wrong kind of string to render, whatever it says today (#782)
Beenu Arorabbc1f9a8e890
diff --git a/services/api/app/api/v1/endpoints/email_approval.py b/services/api/app/api/v1/endpoints/email_approval.pyindex 988014762..65982b934 100644--- a/services/api/app/api/v1/endpoints/email_approval.py+++ b/services/api/app/api/v1/endpoints/email_approval.py@@ -117,6 +117,15 @@ async def email_decide(token: str = Query(..., description="Signed approval toketry:parsed = verify_token(token, secret=secret)except EmailApprovalError as exc:+ # The verifier's message decides *which* fixed page to show; it is+ # never interpolated into one.+ #+ # This is the last of the stack-trace-exposure findings on this route,+ # and it is the one that was hardest to see: the page text read+ # naturally, and the value in it came from an exception. On an+ # unauthenticated page an exception message is the wrong kind of+ # string to render however harmless today's happens to look, because+ # the next one is written by whoever raises next.reason = str(exc)logger.warning("email_approval.token_rejected", reason=reason)expired = "expired" in reason@@ -124,9 +133,9 @@ async def email_decide(token: str = Query(..., description="Signed approval tokebody = "Approval links are valid for one hour. Ask for a fresh one, or approve from the console."else:body = (- f"The link could not be verified ({reason}). If you received it "- "forwarded from someone else, that is why — links are bound to "- "their recipient."+ "The link could not be verified. If you received it forwarded "+ "from someone else, that is why — links are bound to their "+ "recipient.")return _page("This approval link has expired" if expired else "This approval link is not valid",diff --git a/services/api/app/services/llm_safety.py b/services/api/app/services/llm_safety.pyindex b8191d9eb..ed49b2f8e 100644--- a/services/api/app/services/llm_safety.py+++ b/services/api/app/services/llm_safety.py@@ -70,6 +70,24 @@ from app._vendor.llm_contract_rules import (logger = structlog.get_logger(__name__)+# These names are re-exports: callers do+# `from app.services.llm_safety import LLMContractViolation`, and the rules+# themselves live in the vendored copy so `services/api` can carry them+# without the agents service's LangChain dependency.+#+# `__all__` rather than the PEP 484 `X as X` form. The `as` form satisfies+# ruff and *not* CodeQL, which still reads each one as an import nothing uses+# — so it traded one note-level alert for four. `__all__` is what CodeQL+# models as marking a re-export.+__all__ = [+ "LLMContractViolation",+ "LLMInputContract",+ "classify_message",+ "is_contract_enforced",+ "safe_chat_completions_request",+ "validate_messages",+]+DEFAULT_COMPLETIONS_URL = "https://api.openai.com/v1/chat/completions"