Repository navigation
feat(api): add OrcaRouter Cyber Inference as a named BYOK provider with live model catalog - #35
Open
putraperdana1207-pixel wants to merge 1 commit into
Conversation
…th live model catalog Signed-off-by: putraperdana1207-pixel <putraperdana1207-pixel@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
AXGuard's local Security Intelligence API already has a real BYOK provider seam (
engines/api/providers/factory.py:PROVIDER_BASE_URLS+OpenAICompatProvider) consumed by the one model call in the tree —enrichment=llminengines/api/services/pipeline.py— plus the GitHub bot'sai.providerconfig. There was no first-class provider for teams that run authorized, scoped security inference. This PR adds OrcaRouter Cyber Inference as a named provider (own adapter, own config, own docs), not an any-endpoint passthrough.Provider and auth
AXGuard is a CLI + local FastAPI/MCP tool with no OAuth/PKCE login seam (GitHub App auth is a private key; there is no browser-embedded UI), so this integration is API key only, following the repo's existing credential rules: key from
AXGUARD_AI_API_KEY(orai.api_key_env) only, never from repo files, never logged.orcarouteris also a literal name inPROVIDER_BASE_URLSnext toopenai,groq, … so the user-selected provider is visible in config andaxguard api status.engines/api/providers/orcarouter.pyOrcaRouterProvider— basehttps://api.orcarouter.ai/v1, defaultorcarouter/auto, fallbackorcarouter/fusion, cyber tierorcacyber-ultra-1.0/orcacyber-zero-1.5/orcacyber-zero-1.0; credential masking (sk-orca-t…gh), error scrubbing so keys never reach logs orraw, degraded catalog with a 6-entry verified seedengines/api/providers/catalog.pyGET /v1/models+ capability filtersengines/api/routesGET /v1/models?capability=&modality=— key stays server-side;/v1/healthgainsdisplay_name,base_url, maskedcredential_hintengines/api/cli.pyaxguard api models [--capability] [--modality] [--check]engines/github/config.pyai.provider: orcarouter→ OrcaRouter base URL +orcarouter/autodefaults; explicitAXGUARD_AI_BASE_URL/ai.modelwin; literal keys in.axguard.ymlare still ignoreddocs/api/orcarouter.md, provider tables indocs/api/providers.md,docs/github/ai-providers.md,docs/api/overview.mdAPI endpoints touched:
POST /v1/projects/{id}/scans(enrichment gate + the only completion call) and the newGET /v1/models. The GitHub bot path (resolve_ai_credentials) is wired but still inert inengines/github/pipeline.py(_ = ai— no model call today); this PR does not invent one. The CLI and MCP surfaces make no model calls themselves.Model dropdown from the real catalog
The selector is
GET /v1/models, fetched per capability from{base_url}/models; ids keep theirvendor/modelnamespace. Filters use directory metadata only:chat(default):supported_endpoint_types∩ {openai,anthropic,gemini,openai-response}; image-generation, openai-video, jina-rerank and embeddings endpoints are excluded; unknown endpoint types (e.g.systemone) fail closed, and entries with no endpoint metadata at all are treated as chat only when nothing marks them as a non-text generator.chat&modality=image|audio|video: additionally requiresarchitecture.input_modalitiesto declare the modality; undeclared models are excluded (fail closed).embedding/image/video/rerank: exactembeddings/image-generation/openai-video/jina-rerankendpoint types.On fetch failure the response is
"degraded": true, "catalog_source": "seed"with the small verified seed above (GPT-5.5 keepslow/medium/high/xhigh); a successful live result is never mixed with the seed, and the seed is never a free-text fallback.axguard api models --checkexits non-zero when degraded.This repo has no multimodal input path (findings enrichment sends text summaries only), so no multimodal dropdown is required; the modality filter exists and is tested for callers that add one.
Evidence
Tests (
tests/test_orcarouter_provider.py,tests/test_orcarouter_api.py, 39 tests incl. one opt-in live):get_provider(provider="orcarouter")returnsOrcaRouterProvider, defaultorcarouter/auto, basehttps://api.orcarouter.ai/v1; status masks the key.{type: …}endpoint entries accepted./v1/modelsfrom the live (local fake server) path,Authorization: Bearerused and key absent from the response; 422 on unknown capability; 404 for providers without a catalog; degraded seed on 401/network./v1/chat/completionsthrough the provider withorcarouter/autoand an explicit cyber model id; 401 body scrubbed.GET https://api.orcarouter.ai/v1/modelsreturned a live catalog (190 chat-capable models) and a completion succeeded through the provider. The key is not yet unlocked for the cyber tier (orcacyber-ultra-1.0,orcacyber-zero-1.5,orcarouter/autoreturnedmodel_access_denied), so the wiring proof used a public model the key can call. That is a key-entitlement result, not a wiring result.Local run:
pytest -q tests/test_orcarouter_provider.py tests/test_orcarouter_api.py tests/test_api.py tests/test_github_security.py→ 63 passed;python scripts/validate_skills.py→ OK. Full-suite context under Python 3.11 in this environment:engines/report.pyuses an f-string form that only parses on newer interpreters, so 8 modules that import it fail to collect plus 2 CLI smoke tests — unchanged on base, and CI pins Python 3.12; the separate live result above was verified independently on the same code. The opt-in live test timed out once during the full run on a cold connection.Why this provider
Cyber models for your red team, gateway controls for your blue team: red-side adversary and attack-path work on OrcaCyber Ultra / Zero, blue-side pre-ship review, triage and fix verification on the same endpoint. It lets verified security teams send authorized, scoped security-inference requests that general gateways tend to reject or silently downgrade. Provider page: https://www.orcarouter.ai/cyber · cyber catalog: https://www.orcarouter.ai/models?tier=cyber
OrcaRouter is an OpenAI-compatible AI gateway that routes many providers behind one endpoint. It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes.
I'm an engineer on the OrcaRouter team.