Skip to content

Add the OrcaRouter Cyber Inference provider (API key + OAuth 2.0 PKCE) to the veil proxy - #3

Open
flenordchere264-crypto wants to merge 1 commit into
lemonadesaltbagel:mainfrom
flenordchere264-crypto:orcarouter/task-11702
Open

flenordchere264-crypto wants to merge 1 commit into
lemonadesaltbagel:mainfrom
flenordchere264-crypto:orcarouter/task-11702

Conversation

@flenordchere264-crypto

Copy link
Copy Markdown

This adds a first-class OrcaRouter Cyber Inference provider to veil, the local proxy that coding agents (Claude Code, OpenAI-compatible clients) talk to. 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.

What's new

  • prototype/veil/orcarouter.py: a dedicated provider module (id orcarouter, name OrcaRouter Cyber Inference) with its own credential store, kept independent of every other provider in veil.
  • API key auth: veil provider orcarouter api-key accepts an sk-orca-… key from the prompt or from ORCA_KEY; the key is format-checked, stored under a private credentials file in VEIL_HOME, and never printed.
  • OAuth 2.0 + PKCE: veil provider orcarouter pkce runs an authorization-code flow with S256 only — state plus code_challenge, checked with a constant-time comparison on the loopback callback (flow A), plus an out-of-band code-paste flow for headless boxes (flow B). Authorize starts at https://www.orcarouter.ai/auth; the code is exchanged at POST https://www.orcarouter.ai/api/v1/auth/keys on the web origin, never on the API origin. The resulting key is durable (no refresh token), exactly one key per login, and a 401 marks that credential generation as needing re-auth (veil provider orcarouter status).
  • Endpoint overrides ORCA_BASE_URL, ORCA_AUTH_BASE_URL, ORCA_API_BASE_URL; HTTPS is required except on loopback.
  • Live model catalog: veil provider orcarouter models reads GET https://api.orcarouter.ai/v1/models and builds capability-filtered selectors (text, multimodal via --capability multimodal --modality image, tools, etc.).
  • Model tiers: the default is orcarouter/auto; cyber work defaults to orcacyber-ultra-1.0 / orcacyber-zero-1.5; the fallback is orcarouter/fusion.
  • Wiring: veil proxy --provider orcarouter --auth api-key|pkce injects the stored credential for both the Anthropic Messages and OpenAI Chat Completions wire formats and forwards to the API root (no doubled /v1); veil adopt can point a Claude Code settings file at the local proxy with the OrcaRouter model. Docs in README.md.

Tests

prototype/tests/test_orcarouter.py covers provider config, API key connect (including the env-only path that never echoes the key), PKCE S256/state handling for both flows, catalog parsing and capability/capability-modality filters, auth errors and 401 → re-auth, proxy credential injection for both wire formats, and regression tests for the /v1 forwarding and model selection. An opt-in live test (test_live_orcarouter_gateway_end_to_end, skipped unless ORCAROUTER_API_KEY is set) goes through the real proxy handler to the live gateway. Offline: 28 passed, 1 skipped; with the key: 29 passed.

Docs and model tiers: https://www.orcarouter.ai/cyber and https://www.orcarouter.ai/models?tier=cyber.

I'm an engineer on the OrcaRouter team.

…) to the veil proxy

Signed-off-by: flenordchere264-crypto <flenordchere264-crypto@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant