Most developers who route API calls through a relay start from the same quiet assumption: whatever I send, the relay can see. It is not a claim about any specific provider — it is the starting point of a long discussion among developers on the Chinese forum linux.do, and it is the right place to start. Before you argue about which relay is cheapest or fastest, ask what it can see — and what you can do about it before the request ever leaves your machine.
Desensitise — but what does that word have to mean?
In that thread, developers who aggregate channels through a relay (in their case, newapi) kept coming back to four properties. A desensitisation setup is only worth trusting if it is:
- Local. The sensitive text is replaced before the request leaves your machine. If the replacement happens on someone else's server, you have just moved the problem, not solved it.
-
Two-way. The reply comes back with placeholders, and the original values are restored on your side before you read it. One-way redaction leaves you with a reply full of
[REDACTED]where your own data used to be. - Reversible. You can get the original back, reliably, every time — including across long conversations where the same secret appears ten times.
- Switchable. You can turn it off. Sometimes the model genuinely needs the real value: a password it must log in with, an account number it must look up. A filter you cannot disable becomes a bug.
Those four properties are a useful test for any tool that claims to protect your data. If a tool cannot explain how it meets all four, treat its claims with suspicion.
The honest doubt: the second leak
The sharpest point in the thread was not about a tool at all. It was a question: if the desensitisation itself uses an AI, hasn't the sensitive text already left?
That is the second-leak problem, and it deserves to be stated plainly. Sending your secrets to a second AI service so that it can hide them from the first AI service is not obviously an improvement. You have doubled the number of systems that see your data. This is why participants in the thread consistently preferred rule-based replacement and locally run gateways over AI-based desensitisation. A regular expression that swaps sk-live-... for API_KEY_1 never phones home. A local model that never leaves your machine is a different proposition from a remote API that promises to forget.
None of this makes any desensitisation method leak-proof. The honest framing is a trade-off, not a guarantee: every layer you add reduces exposure to one party and introduces trust in another. Say so, and choose accordingly.
Three patterns the community actually uses
The thread surfaced three approaches, described here as community recommendations — not tested here, and not endorsed by any provider. Each comes with a usability cost, which is part of the point.
1. A desensitisation tool that replaces on the way out and restores on the way back. The example named in the thread was magpie, which supports standard OpenAI chat-completion requests and can automatically replace sensitive values before sending and restore them in the reply. The appeal is that it is transparent to the application: your code talks to it like any other endpoint. The cost is the one the thread kept tripping over — when the model cannot see a value it needs, it sometimes refuses, or hallucinates around the gap. A model told "the password is [SECRET_1]" may simply say it cannot help.
2. A local LLM gateway with zero-code, two-way desensitisation. This pattern puts a small gateway on your own machine (or your own server) between your code and the relay. It intercepts requests, replaces sensitive spans, forwards the cleaned request, then reverses the replacement in the response. Because it runs locally, the sensitive text never leaves your network for the desensitisation step itself. The cost is operational: you now run and maintain another component, and its replacement rules are only as good as the patterns you configure.
3. A privacy gateway or a built-in privacy filter. The thread also mentioned AstrLink, a privacy gateway from the newapi author, and noted that the newest version of CCS ships with a privacy filter. These bundle the filtering into the relay-adjacent tooling itself, which is convenient — and which is exactly why the trust question matters most here. A filter that lives inside the system you are trying to protect yourself from is only useful if you can verify what it does, and switch it off.
A minimal version of the core idea fits in a few lines of code — a placeholder map, applied before sending and reversed after receiving:
secrets = {"sk-live-9f2...": "API_KEY_1", "admin@corp.com": "EMAIL_1"}
def desensitise(text):
for real, placeholder in secrets.items():
text = text.replace(real, placeholder)
return text
def restore(text):
for real, placeholder in secrets.items():
text = text.replace(placeholder, real)
return text
reply = client.chat(desensitise(prompt))
print(restore(reply))
That is not a product recommendation — it is the mechanism, stripped bare, so you can see what any tool in this space is actually doing for you.
A checklist before you send anything sensitive through any relay
Whatever tooling you choose, the thread's practical advice boils down to a short routine:
- Redact first, by category. API keys and passwords first, then customer data, then internal URLs and hostnames, then anything that identifies a real person. If you would not paste it into a public chat, do not send it raw to a relay.
- Test with a harmless secret. Send a fake credential through your setup and check that the reply restores it correctly — and that the model did not see the original. If the round-trip breaks, your filter is not two-way, and you will find out on a real secret instead.
- Keep a local log of what you redacted. Not the values — the categories and the count. When something goes wrong, you need to know what was in the request without storing the secrets a second time.
- Ask the relay the four questions. Does it store your requests? Does it train on them? Can you desensitise locally before sending? And can you turn any of it off? The answers matter less than whether they are written down somewhere you can check — and whether the provider treats those questions as normal.
Price is the easiest thing to compare between relays, which is why it dominates every discussion. But price is only the first question. The second one — what does it see, and what can I do about it — is the one that decides whether you can actually use the cheapest option for real work.
If you route through a relay, ask it the same questions — does it store your data, does it train on it, and can you desensitise locally before sending — zhuan.xyz
Top comments (0)