Draft for the public Alyren docs.
Alyren for an AI agent
An agent drafts, then it acts. It sends a mail, an SMS, or it writes in a CRM. The model must not see the customer. The customer must not receive the twin.
Alyren sits in the agent process, on the same server as the agent. It holds the key. The model has no restore tool.
Product overview: Alyren. The chat extension is a different surface: Extension.
The point
your data → cloak → the model drafts with the twin
the draft → uncloak → mail, SMS, or CRM receives the real customer
the receipt → cloak → the model does not see the real address againThe clear value exists on the agent server only for the outbound call. The mail server needs the real address. That address is not in the request to the model.
Alyren does not send the mail. The agent's own tool does. Alyren wraps that tool.
Set up the key
- Open the studio, page Agent: alyren.veilio.fr/studio#agent.
- Create an
alr_live_key and name it after the agent. Copy and revoke live on that page. It is the same vault as the other API keys. - On the agent server, set the URL and the key. Do not put either in the prompt, and do not give them to the model.
ALYREN_URL=https://alyren.veilio.fr
ALYREN_API_KEY=alr_live_...If the originals must not transit through the Alyren cloud, run Alyren on your network and set ALYREN_URL to that internal URL. The proxy code stays the same.
Install the proxy
Copy agent/proxy.mjs into the agent process. It calls POST /v1/cloak and POST /v1/uncloak. The model never calls those routes.
import { createProxy } from "./agent/proxy.mjs";
const alyren = createProxy();
const tour = await alyren.run({
input: userText,
model,
tools: {
send_email: {
async prepare(mail) {
return mail;
},
async commit(mail) {
return sendWithYourTool(mail);
},
},
},
});run cloaks the user text, calls your model with that text only, runs the tool, then cloaks the tool result before the model sees it again.
prepare must not send. commit runs only after the cloak of the draft succeeded. commit receives the real name and the real email.
Default outbound names are send_email, send_sms, and crm_write. Any other tool that leaves the agent must be listed in outbound when you create the proxy. A tool that is not outbound keeps the twins.
What each side receives
| Step | Sees |
|---|---|
| Model, input | Twins |
prepare / commit of an outbound tool | Originals |
| Model, tool result | Twins again |
| Alyren ledger | Type, count, channel agent |
Example in, twins out to the model:
Écris à Jean Dupont, jean.dupont@acme.frThe outbound tool then receives Jean Dupont and jean.dupont@acme.fr again. One cloaked field costs one credit, on the way to the model and on the receipt when that receipt still contains a personal field.
When Alyren fails
| Failure | Result |
|---|---|
| Cloak of the user text fails, or credits are empty | The model is not called |
| Uncloak fails before an outbound tool | commit is not called. Nothing is sent |
| Cloak of the draft fails | commit is not called |
| The tool itself throws | The model does not receive the error text, so a bounce cannot leak the address |
Cloak of the receipt fails after commit | The send already happened. The model still receives the cloaked draft, not the clear receipt |
The chat extension stays fail-open: a broken cloak does not freeze ChatGPT. The agent path is fail-closed: a broken cloak does not send.
What this integration is not
- It is not a mail server. Your agent already has the tool that sends.
- It is not browser automation.
- It is not Veilio Core, and it does not use a Veilio API key.
- It does not log the original value. Do not log the arguments after uncloak in the agent either.