feat(cliproxy): restrict Kamino credentials by model family

Merged
SH
1d ago
+134-2

Changes

  • Add declarative model_family policies to Kamino credential mappings.
  • Enforce per-OAuth credential model-family exclusions in CLIProxy, preserving operator-authored exclusions.
  • Expose the policy in generated kamino-fleet.json and document the configuration.

Technical details

A model_family: haiku mapping excludes Claude model IDs containing opus, sonnet, or fable, so that credential can only register and route to Haiku models. Unknown families fail closed during Nix evaluation or proxy rendering.

Testing

  • shellspec spec/cliproxyapi_spec.sh spec/kamino_fleet_spec.sh (99 examples, 0 failures)
  • Nix evaluation/build of the Kamino package
  • bash -n, ShellCheck, nixfmt --check, and git diff --check

Generated with Codex.


Summary by cubic

Restricts Kamino tunnel credentials to a declared model family so OAuth credentials can only route to the models they are approved for.

  • Adds an optional model_family field to kamino-tunnels.json; the CLIProxy start script renders it into excluded_models rules on the matching auth file before starting.
  • Validates the family at Nix evaluation and in the proxy renderer; unknown families fail closed instead of silently widening routes.
  • Generates kamino-fleet.json with the same model_family field and strips previously generated exclusions when a policy is removed.
  • Sets the claude-2738f2fb-jangly-bears6h@icloud.com credential to haiku, so it can no longer serve Opus, Sonnet, or Fable models.

Migration

  • Any credential you want restricted needs a model_family entry in kamino-tunnels.json. Credentials without one keep their current behavior.