How Mila did it: case studies and news
Any bot can promise to keep your clients’ secrets. A promise cannot be checked; a line of code can. Mila has one constitution of 10 laws. Below, each law comes with a plain retelling, the mechanism in the code with a link, and an honest note where there is no code: code holds 7 laws, law 10 halfway, laws 8 and 9 are a rule only.
For an owner who wants to know what the assistant will not do behind his back.
Code is a hook or a script that stops the action by itself. A rule is a line in a skill: the model keeps it, and you can check it only by what Mila does. The laws live in CONSTITUTION.md, the file every Mila reads first. CONSTITUTION.md:15-24
| Law | What holds it | Kind |
|---|---|---|
| 1 · A person’s secret | The send guard: unconnected chats, other chats’ @tags and names | Code |
| 2 · Facts and evidence | task.py: “done” without evidence is not written | Code |
| 3 · On your behalf | bot-send: a broadcast is a preview and your tap on that text | Code |
| 4 · Money and the irreversible | spend: above the threshold only by your tap | Code |
| 5 · Personal data | Labels in memory, an encrypted vault, a masked card number | Code |
| 6 · No and silence | No answer by the deadline means no; “stop” goes to the stop list | Code |
| 7 · No apologies | The send guard does not let “sorry” through | Code |
| 8 · A mentor | The “Path” method | Rule |
| 9 · Fears and doubts | No mechanism | Rule |
| 10 · Every day, in measure | Rituals survive a restart; no counter for the measure | Halfway |
A person’s secret does not pass to anyone else, in words or in memory. The guard checks every message before it goes: the recipient must be the owner or a chat Mila was connected to. No @tag of a person and no chat name goes into a chat where it never appeared but does appear in another. If the guard crashes or hangs, the message does not go. send-guard.py:25-38 send-guard.py:118-177 install.sh:303-312
Limit: the lock catches tags and names, not a retelling in other words. Memory has no wall between chats — one session serves them all, so the protection sits at the exit. send-guard.py:119-121 send-guard.py:178-179
A fact comes from a tool, not from memory. The done command without evidence writes nothing. The script runs the evidence itself, right now — a command, an address, a message, a commit; if it fails, the task stays open. A client’s task is closed only by someone else’s hand: the person’s word or their message. After every reply a hook finds promises in the text and records them with a deadline. task.py:63 task.py:684-689 task.py:690-708 task-sent.py:1-10 task-open.py:1-3
Limit: the script does not watch the chat, so the word “ready” without done is not stopped by code. “No data — I say so” is a rule only. mila-tasks:9 mila-tasks:53
A broadcast from your public bot takes two steps: a preview “N people” with the full text, then sending only after your ✅. The preview lives for an hour; a second tap sends nothing. Mila can write only to people who wrote to the bot first. If Telegram says to wait longer than an hour, the rest does not go by itself: you get a new preview of the same text, because yesterday’s tap does not count. bot_send.py:131-144 bot_send.py:146-155 bot_send.py:22 bot_send.py:173-180 bot_send.py:117-118 bot-send:14-20
Limit: an ordinary reply in a chat Mila was connected to does not wait for a button. The guard checks the recipient, keys and internals, not your tap; the README says so. README.md:82
Money, the irreversible and your word — only when you yourself decided so, and the choice is written to the log. Before a paid generation spend gives an estimate with a 10 % margin. Above the threshold comes a card marked with that spend. Only a tap recorded by the Telegram plugin lets the money go — not an id Mila types herself. One card, one spend. Someone with a budget from the owner can let through only their own spend, within that budget. The monthly cap, budgets and the list of owners change only by your tap too. Each spend is a line in the log: who tapped, which card. spend.py:94-104 spend.py:51-74 spend.py:105-122 spend.py:134-146
Limit: a spend below the threshold goes by itself, as a line in the log. Deleting, publishing and promising have no common lock in the code: skills and the tool rules hold them. Until 28.10 a spend was let through by an id in an argument that Mila writes herself; since v1.6.4 only a tap. spend.py:33 spend.py:99 permission_policy.ts:19-25 cards:34 topics:29 mila-update:89 spend.py:19-23 test_spend_tap.py:1-3
After a write to memory, logs and cards a hook replaces phone numbers, e-mails, card numbers, passports and PINFL with short labels: the kind of data and a number. The values go to an encrypted vault (AES-256 and HMAC: a tampered file will not open). A card number never goes to a group; in a direct chat it goes masked as ****1234. In your own clone of the core, a commit with your ids and names is not created. pd-mask.py:1-13 pd_vault.py:1-13 send-guard.py:51-85 send-guard.py:181-185 install_privacy_hook.sh:1-11
Limit: the model reads an incoming message whole; the vault protects what Mila keeps and passes on. A value is revealed only to the owner in his direct chat, and the skill decides that, not the code. PD_MASK=0 turns the mask off. pd-vault:19-23 pd_vault.py:5-10 pd-mask.py:2-4
A card asking for a tool right with no answer by the deadline is a refusal, and Mila has to say she did not do it. A closed card cannot be opened again; “Until tomorrow” brings it back at 9:00. “Stop” in the bot puts the person on the stop list, and a broadcast skips them even from the queue. permission_policy.ts:14-15 REFERENCE.md:352-355 cards.py:251-255 cards.py:244-248 bot_send.py:211-214 bot_send.py:166
Limit: a fork in the tasks whose deadline has passed is closed with its default option, an honest line “no answer for N h” and a way to undo it. Such a fork is not created without an undo and a deadline, and its timer stands still until the message is delivered. task.py:833-853 mila-tasks:55
The guard does not let apologies and excuses into a chat — the Russian words for “sorry”, “forgive me”, “my mistake”, “my fault”, “unfortunately I did not manage”, and the English sorry — neither to a client nor to the owner. The reason for the stop points to law 7. The exception is a report with a defect number. send-guard.py:99-106 test_send_guard.py:25
Limit: the guard catches words, not tone. Whether a reply has a fact, a conclusion and a step, the code does not check.
Lead the person to the goal they named themselves and measure herself by their result. The support is the “Path” method: a milestone is passed when something happened in the person’s life, not when a button was pressed in the bot. The code has no goal of the person and no measure of the result.
CONSTITUTION.md:22 mila-path:20-22When a person stalls, she answers with a small step, a fact or an example, not a judgement. There is no mechanism in the code, and no skill quotes this law separately.
CONSTITUTION.md:23Code holds “every day”: the ritual schedule survives a session restart, and missing crons come back at start. A rule holds the measure: silence is normal, no more than three planned touches a day. There is no counter of “messages on her own per day”; a similar cap per hour exists only for Milas writing to each other.
crons-keeper.py:1-7 CONSTITUTION.md:24 client-chat:105 companion-feeder.py:332-336The constitution is the file CONSTITUTION.md: one for every Mila, read first. The owner has the right to change it. CONSTITUTION.md:15-24
A new version comes with an update. The update plan shows it as a separate line — “read before Update” — and rates the risk no lower than medium. update.py:782-791 update.py:827-832
If you have your own version, the update does not advise replacing it with the core’s: yours can be newer. On 28.10 law 4 in the core was brought to the text the owner had set on 20.09. update.py:797-799 CONSTITUTION.md:18
| File | What it does |
|---|---|
| CONSTITUTION.md | the text: the preamble and the 10 laws |
| hooks/send-guard.py | the send guard: recipient, other chats’ business, card numbers, apologies — laws 1, 5, 7 |
| skills/mila-tasks/task.py | “done” only with evidence, forks with a deadline — laws 2 and 6 |
| skills/bot-send/bot_send.py | broadcast: preview, tap, stop list — laws 3 and 6 |
| skills/spend/spend.py | spending: estimate, threshold, the owner’s tap — law 4 |
| install/permission_policy.ts | tool rights: no answer by the deadline means no — laws 4 and 6 |
| install/pd-mask.py | labels instead of personal data — law 5 |
| skills/pd-vault/pd_vault.py | the encrypted vault — law 5 |
| skills/cards/cards.py | cards: a closed card does not open again — law 6 |
| install/crons-keeper.py | rituals survive a restart — law 10 |
The kit is open: skills, hooks, tools and templates. Every pull request is read by a person and by Mila Quality.
Facts on this page: github.com/shakhruz/mila (main, 1d0a4c4), checked 28 Oct 2026. The chat in the phone is an illustration. “Mila”, “MILAGPT” and the logo are trademarks of MILAGPT.