Please report security issues privately through GitHub private vulnerability reporting (the repository's Security tab, "Report a vulnerability"). Do not open a public issue, and do not include real credentials, tokens, prompts or outputs in a report.
ezswap is pre-1.0. Only the latest version receives fixes.
ezswap reads trace files that can hold production prompts and outputs, and it calls model endpoints with your keys. It is designed to keep these boundaries:
- No telemetry unless you turn it on. By default ezswap makes no network
request except the model calls a
runormapsends to the endpoints you name, the callsrecordforwards for your app to the one upstream you name, one price lookup, and withmap --judgeorjudgethe judge's calls.demoandreportmake none. - Opt-in telemetry sends no trace content. If you answer yes to the
guided workflow's question or run
ezswap telemetry on, each command sends one event to PostHog: the command, how it ended, counts, and the names of models the bundled price catalog knows. A prompt, reply, key, path, base URL, part name, private model name or error message is never in it. The fields are a fixed list indocs/telemetry.md, and a test fails if an event carries any other.DO_NOT_TRACK=1,EZSWAP_TELEMETRY=0orCIkeeps it off. - The price lookup sends model names only. When
estimate,runormapis given acreator/modelid that the bundled price catalog cannot price, ezswap asks Metergraph's Pricing API (POST https://app.metergraph.dev/v1/pricing/lookup) for those ids and thevercel-ai-gatewaychannel. Nothing from the trace file, no prompt, output or key, goes with it. Answers, unknown models included, are cached for a day in the user cache directory (ezswap/pricing-lookup.json, mode 0600).--no-price-lookuporEZSWAP_NO_PRICE_LOOKUP=1turns it off;METERGRAPH_PRICING_URLpoints it elsewhere. A failed lookup leaves the models unpriced and the run goes on. - The judge sees free-text replies, only when asked.
map --judgeandjudgesend each judged case's system prompt, messages and two replies to the Vercel AI Gateway (POST https://ai-gateway.vercel.sh/v1/decisions) fortypesafe-ai/jev, with zero data retention requested, usingAI_GATEWAY_API_KEY. Without either, nothing is sent to a judge. recordlistens on this machine only. It binds127.0.0.1on one port (default 8787). It answers a request only when the request names127.0.0.1:<port>orlocalhost:<port>as its host and carries noOriginheader, and refuses the rest with a 403, so a web page cannot reach it. It has no authentication of its own and holds no key: another program on the machine can send calls through it with a key of its own, and those calls are recorded too.recordforwards to one upstream. Every request goes to the upstream you name (defaulthttps://api.openai.com), with its path, query string and headers as the app sent them, minus the twoX-Ezswap-*headers. The upstream must behttps, orhttpto a loopback host, and may not embed a user name. The standard proxy environment variables apply to forwarded calls.recordnever writes or shows a header or a query string. API keys travel in both. The only header values kept areX-Ezswap-PartandX-Ezswap-Trace, cleaned and cut to 64 characters. Error messages do not repeat the upstream URL.traces.jsonlholds your prompts and responses.recordwrites each captured call's request and response bodies as they were sent. It does not look inside a body, so a credential your app puts in a request body (a token for a remote tool server, say) is written to the file. The file is created with mode0600in a directory created with0700; an existing file keeps its mode. Keep it out of Git.- Keys stay in the environment. API keys are read from environment
variables only. They are never written to
run.json, printed, or included in errors. A base URL that embeds a username or password is refused.recordreads no key at all: your app's key passes through it in a header. - Spend is bounded.
runandmapprice the run first, ask before spending, and reserve each call's maximum cost before sending it, so they stop at--budget. A call billed above the catalog's price can take a run past the budget by its overrun; the run then reserves more for that model, and stops if the overrun is large or repeats.recordspends nothing of its own; the calls it forwards are your app's. - Captured text cannot drive the terminal. Prompts and outputs are cleaned before they are drawn: control characters, escape sequences and bidirectional overrides are shown as visible text, never sent to the terminal.
run.jsonholds your trace content. It contains the sampled prompts and every model's output, so treat it like the trace file it came from.- The names file holds no content.
ezswap-parts.json, written beside the trace file byestimate --mapandmap, holds part keys and names only. A fingerprint key is a truncated hash of the system prompt, forced tool name and response schema. A part name is whatever you chose. - The printed map shows field values, not prompts. Under WHAT CHANGED it prints the old and new value of a changed field, cleaned like all captured text. It prints no prompt and no whole reply.
- Few dependencies, no install scripts. The binary is statically built Go; its only third-party code is the Charm terminal libraries. The npm package is a small launcher that runs the binary from a per-platform package; it has no install script and downloads nothing.