Security
Reporting a vulnerability
Please do not open a public issue for security problems. Email francois@chastel.co with a description, reproduction steps, and the version affected. You will get an acknowledgement within 72 hours and a fix or mitigation plan as soon as one is available. Credit is given in the release notes unless you prefer otherwise.
What this tool touches
Outbound traffic
One POST per tool call (.../v1/systemone, or the host's own decision endpoint), to the host your key belongs to:
https://api.typesafe.ai(TypeSafe)https://openrouter.ai/api(OpenRouter)https://ai-gateway.vercel.sh/typesafe(Vercel AI Gateway)https://api.openai.com(OpenAI Decisions API), only whenJEV_CODE_PROVIDER=openai- your Azure OpenAI resource (
AZURE_OPENAI_ENDPOINT), only whenJEV_CODE_PROVIDER=azure - your Microsoft Foundry resource (
AZURE_ENDPOINT), only whenJEV_CODE_PROVIDER=foundry; both endpoints must be https hosts underazure.com,azure.us, orazure.cn, judged on the parsed URL https://generativelanguage.googleapis.com(Gemini), only whenJEV_CODE_PROVIDER=geminihttps://api.perplexity.ai(Perplexity), only whenJEV_CODE_PROVIDER=perplexityhttps://api.cloudflare.comunder your account (CLOUDFLARE_ACCOUNT_ID), only whenJEV_CODE_PROVIDER=cloudflarehttp://localhost:11434, orOLLAMA_HOST(Ollama), only whenJEV_CODE_PROVIDER=ollama; no key is sent unlessOLLAMA_API_KEYis set- or
TYPESAFE_BASE_URLwhen set, under the proxy rule below: a proxy, or a System One gateway of your own. The value is checked before any request (absolutehttp(s), no embedded credentials, query, or fragment), and so isOLLAMA_HOST. A base URL on one of the known hosts above whileJEV_CODE_PROVIDERnames another is refused, for Ollama too, andOLLAMA_HOSTmay not name a known host.
The known hosts, and every host under an Azure cloud domain, are reached over https only: an http:// URL naming one of them is refused, and so is an Azure endpoint that is not https, so their keys never travel in clear text. Plain http is accepted for a gateway of your own and for an Ollama server, which may sit on a private network; when a key would cross a network that way (any host other than localhost or a loopback address), doctor and setup say so.
Transport
- Exactly one
POSTper attempt, to the configured URL. Redirects are never followed: a 3xx answer is an error, so the payload cannot be forwarded to another origin. - Each attempt has a timeout (
JEV_CODE_TIMEOUT_MS, 30 s by default) that covers reading the answer as well as connecting. Answers larger than 1 MiB are refused without being buffered. - Text from the host that ends up in an error the agent reads (its error message and request id) is cut to 300 and 100 characters and flattened to one line, so a misbehaving host can neither flood the agent's context nor fake structure in it.
- Retries cover 408, 425, 429, 500, 502, 503, 504, 529, and connection failures, with exponential backoff (
JEV_CODE_MAX_RETRIES, 2 by default);retry-afteris honoured up to 30 s.
doctor --live sends one such request with a fixed one-word payload. So does setup when you choose "Other System One gateway" for a pasted key: it checks the gateway with that key before storing it, and sends nothing else.
The payload is what the agent passed to a tool: items, questions, optional context. Through OpenRouter or Vercel AI Gateway it transits that gateway on its way to TypeSafe. jev-code never reads files, git state, or session history on its own.
Credentials
- The key is read from
TYPESAFE_API_KEY,OPENROUTER_API_KEY, orAI_GATEWAY_API_KEY. The variable decides the host; a key's shape never does, because shapes change (TypeSafe issuests_andapikey_keys). A key that looks like another host's earns a hint in doctor, nothing more. OPENAI_API_KEYis never adopted on its own, even when it is the only key set, because many unrelated tools set it. OpenAI's Decisions API is used only withJEV_CODE_PROVIDER=openai; until then doctor and the missing-key error say the key is there and how to opt in. The same holds for every other host that runs another company's model:AZURE_OPENAI_API_KEY,AZURE_API_KEY,GEMINI_API_KEY,PERPLEXITY_API_KEY, andCLOUDFLARE_API_TOKENcount only whenJEV_CODE_PROVIDERnames their host, andTYPESAFE_API_KEYnever follows an override to one of them.TYPESAFE_API_KEYis the generic variable the TypeSafe SDK reads, so it followsTYPESAFE_BASE_URLandJEV_CODE_PROVIDERas the SDK does, including to a proxy. A host-specific variable (OPENROUTER_API_KEY,AI_GATEWAY_API_KEY,OPENAI_API_KEY) is sent only to its own host: a base URL on another known host is refused before any request, and a proxy needsJEV_CODE_PROVIDERto state the intent, so a key another tool exported never follows a stray override.- Keys are never echoed or logged.
doctor,setup, and the MCP server's one stderr line show a masked hint (sk-o…1234); printed commands show<your key>; a harness CLI's output is scrubbed of the key before it is shown. A key holding whitespace or a control character is refused before any request, without being quoted: an HTTP stack would otherwise reject the header and print it. As a last line of defence, the client removes the key's exact value from every error message it raises and from the body an API error carries. setupcopies the one key in use, and only that one, into user-level harness MCP configurations, because some harnesses filter the environment before launching servers;--no-envdisables that. In a terminal,setupcan take the key from a hidden prompt (--no-promptdisables it); a pasted key goes to the same places and nowhere else.- Project-scope files (
.mcp.json,opencode.json) are meant to be committed, so they never hold a key:setup --projectwrites a reference the harness expands at launch (${TYPESAFE_API_KEY}for Claude Code,{env:TYPESAFE_API_KEY}for OpenCode), and the key stays in your shell. - Registering through
claude mcp addorcodex mcp addpasses the key as a command-line argument for the second that command runs, where another user of the same machine could see it inps. On a shared machine, use--no-envand export the key instead.
Local writes
setup writes the skill directory and, depending on the harness, a JSON or TOML config entry. Existing config files are backed up beside the original as <file>.bak-<timestamp> before modification; a backup never overwrites an existing file. A config file that setup writes itself (opencode.json, .mcp.json when the claude CLI is absent, Codex's config.toml when the codex CLI is absent) is made readable by its owner only when it holds a key (mode 0600, directories it creates 0700), and so is every backup, since a backup keeps the previous key; delete old backups once you no longer need them. Files that claude mcp add and codex mcp add write keep the permissions those CLIs give them. Modes apply on macOS and Linux; Windows ignores them.
A project file written by 0.5.1 or earlier held the key itself. Running setup --project again replaces it with a reference and says so; if the file was ever committed or shared, rotate the key, and delete the .bak-* backup setup leaves beside it, which still holds the key. Malformed JSON is left untouched and reported. Codex's TOML is not parsed: setup edits only the [mcp_servers.jev] block, line by line, and leaves the rest of the file as it was.
Execution
setup runs the harness CLIs (claude, codex, pi) found on PATH with fixed arguments; no shell is involved.
Supported versions
Only the latest published minor version receives fixes.