Skip to content

fix(auth): resolve actual LITELLM_API_KEY value for LiteLLM provider - #30

Open
magqqgq wants to merge 1 commit into
MetaMask:mainfrom
magqqgq:magqqgq-patch-1
Open

magqqgq wants to merge 1 commit into
MetaMask:mainfrom
magqqgq:magqqgq-patch-1

Conversation

@magqqgq

@magqqgq magqqgq commented Sep 19, 2026

Copy link
Copy Markdown

Description

Remediates a credential-handling bug (CWE-522) in the Pi adapter runtime (agent-runner).

Previously, createSession verified that process.env.LITELLM_API_KEY was populated but registered the provider using the literal string '$LITELLM_API_KEY'. Consequently, all outgoing LiteLLM requests sent Authorization: Bearer $LITELLM_API_KEY, causing silent upstream authentication failures while masking the configuration defect.

Key Changes & Remediations

  • Provider Key Resolution (src/adapters/pi/pi-runtime.ts):
    • Replaced the string literal '$LITELLM_API_KEY' with the actual runtime environment value process.env.LITELLM_API_KEY.

Verification

  • Validated syntax stripping: ```bash node --experimental-strip-types --check src/adapters/pi/pi-runtime.ts

Confirmed absence of literal $LITELLM_API_KEY key assignment in provider registration.

## Description
Remediates a credential-handling bug (CWE-522) in the Pi adapter runtime (`agent-runner`).

Previously, `createSession` verified that `process.env.LITELLM_API_KEY` was populated but registered the provider using the literal string `'$LITELLM_API_KEY'`. Consequently, all outgoing LiteLLM requests sent `Authorization: Bearer $LITELLM_API_KEY`, causing silent upstream authentication failures while masking the configuration defect.

## Key Changes & Remediations

* **Provider Key Resolution (`src/adapters/pi/pi-runtime.ts`)**:
  - Replaced the string literal `'$LITELLM_API_KEY'` with the actual runtime environment value `process.env.LITELLM_API_KEY`.

## Verification
- Validated syntax stripping:
  ```bash
  node --experimental-strip-types --check src/adapters/pi/pi-runtime.ts

This branch has not been deployed

No deployments
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