Skip to content

docs(llm_local): document the mock API key - #87

Merged
felipepenha merged 2 commits into
GenAI-Security-Project:mainfrom
wehnsdaefflae:docs/llm-local-auth-section
Sep 20, 2026
Merged

felipepenha merged 2 commits into
GenAI-Security-Project:mainfrom
wehnsdaefflae:docs/llm-local-auth-section

Conversation

@wehnsdaefflae

Copy link
Copy Markdown

Summary

Closes #83. Adds an Authentication subsection to the llm_local README.

Correction to my own issue first: the README does mention sk-mock-key, in the chat completion curl example and in a Notes bullet near the bottom. I said it never does, which was wrong.

The problem is that it isn't anywhere readers look before their first request. There is no auth section, and the base URL appears without the key. Point a client at http://localhost:8000/v1, get a 401, and nothing in the doc explains why until the curl example further down.

Changes

  • README.md: new "Authentication" subsection at the top of "Testing the Mock API":
    • which endpoints need Authorization: Bearer sk-mock-key (/v1/*) and which don't (/health)
    • what a missing header, a wrong key, and a non-Bearer scheme each return
    • a line saying to point an OpenAI-compatible client at http://localhost:8000/v1 with that key

No other prose changed. The models endpoint is documented in #86, so this PR doesn't describe a route that hasn't landed.

The README does mention sk-mock-key, in the chat completion curl example
and in a Notes bullet near the bottom. What it lacks is the key anywhere
a reader looks before their first request: there is no authentication
section, and the base URL appears without it. Point a client at
http://localhost:8000/v1, get a 401, and nothing explains why until a
curl example further down.

This adds an Authentication subsection at the top of Testing the Mock
API, saying which routes need the header and what a missing header, a
wrong key and a non-Bearer scheme each return. No other prose changed.

Closes GenAI-Security-Project#83.
Comment thread sandboxes/llm_local/README.md Outdated
Felipe's review on GenAI-Security-Project#87: the response documented here is the one GenAI-Security-Project#86 changes, so the
table now reads `401 Missing Authorization header` with no credential in it.

Also drops an em-dash from the Authentication paragraph.
@felipepenha
felipepenha merged commit e75c171 into GenAI-Security-Project:main Sep 20, 2026
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.

llm_local: the mock requires Authorization: Bearer sk-mock-key and the README does not say so

2 participants