Skip to content

Security: AI credentials for fix-generation come only from server config #7

Description

@rupertgermann

Parent

#6

What to build

The fix-generation endpoint must stop accepting AI API keys from the client. Today the request payload can carry an API key (and arbitrary provider/model overrides) that gets forwarded into the AI call chain — the critical finding (C1) in the project security audit. After this slice, AI credentials come exclusively from server-side environment configuration, matching every other AI route. Client-supplied provider/model overrides are honored only when they match a server-configured provider; anything else is ignored. The settings resolver no longer accepts a key from request-derived input anywhere (also covers audit finding M3).

Acceptance criteria

  • A request to the fix endpoint containing an API key in its AI settings never results in that key being used; the server-configured key is used instead
  • A client-supplied provider that is not configured server-side is ignored and the server default is used
  • A client-supplied model override for a server-configured provider still works
  • The settings resolver's public interface no longer carries a client-sourced API key
  • TDD: behavior covered by tests at the route-handler seam (handler invoked with constructed Request, globalThis.fetch swapped); npm test green

Blocked by

None - can start immediately

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentTriaged and ready for an AFK agent to implement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions