aliaster-bot
by zonzideka
README.md
# Aliaster
Aliaster is an agent mail identity layer. An agent names a logical identity and a read, reply, or send intent. SimpleLogin and Gmail stay behind that identity, so the agent does not choose a mailbox, a provider account, or a transport hop. The point is a small, fail-closed boundary: policy and opaque handles on the agent side, vendor credentials and reverse aliases on the operator side.
The current line is the Rust workspace in `crates/`. The package version is `1.0.0-dev`. The Python tree under `src/aliaster` (package `0.20.0`) is frozen for reference and for tests that still call it. It is not the CLI or the MCP server operators run.
## Features
What the Rust tree actually ships:
- Exactly four MCP tools, in this order: `mail.send_mail`, `mail.reply_thread`, `mail.search_mail`, `mail.get_thread`. Underscore aliases of those names are accepted on call. No fifth tool is registered. `prepare-send` and `contact` stay inside the engine.
- A policy gateway that runs before a provider write: READ / REPLY / SEND grants, a new-send recipient mode (deny-new-send, allow-all, allowlist, or denylist), a UTC daily quota, and caller-supplied `request_id` idempotency.
- One Rust alias provider (SimpleLogin) and one Rust mail transport (Gmail). Agent results use service-owned message, thread, and case refs. Reverse-alias plaintext is not returned on the agent-facing API.
- Credentials in files (mode `0600` or stricter, owned by the current user, opened with `O_NOFOLLOW`). The MCP registration env is only `ALIASTER_CONFIG`, `ALIASTER_CASES`, and `ALIASTER_AGENT`.
- `aliaster verify` takes the exclusive workspace lock and can open the gate at `VERIFIED_OPEN`. `aliaster doctor` and `aliaster mail status` are lock-free reads.
- `aliaster update` checks or installs a GitHub release asset through the `gh` login already on the machine. SHA-256 is required. There is no token flag. A release tag is not approved, so there is no published release to install yet.
## Architecture
Normative detail is [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md). The agent never sees mailbox selectors, vendor ids, or credentials.
```mermaid
flowchart TD
Agent["Agent: identity plus read, reply, or send"]
Gateway["Policy gateway: grants, recipients, UTC quota, request_id"]
Registry["Identity registry and lifecycle"]
SL["Alias provider: SimpleLogin"]
Gmail["Mail transport: Gmail"]
Agent --> Gateway --> Registry
Registry --> SL
Registry --> Gmail
```
An identity has one mailbox and one transport in v1. Drivers own vendor-specific behavior. The registry owns the stable name, lifecycle state, and the opaque refs the agent is allowed to hold.
## Quick start
Build the operator binary from this checkout. Rust 1.85 or newer matches the workspace `rust-version`.
```bash
cargo build -p aliaster-cli --bin aliaster
export PATH="$PWD/target/debug:$PATH"
```
`aliaster init` creates a workspace directory (mode `0700`), a starter `identities.yaml`, and a file-backend secret declaration. The starter identity is `paper` at `paper@example.com`, and the starter policy grant is the principal `planner`. The example file in the repo is not loaded.
```bash
aliaster init --workspace "$HOME/.config/aliaster/demo"
# Edit identities.yaml before any live send.
# Point credential files at mode-0600 files. Do not put secret bytes in the shell history if you can avoid it.
export ALIASTER_AGENT=planner
aliaster verify --workspace "$HOME/.config/aliaster/demo"
aliaster doctor --workspace "$HOME/.config/aliaster/demo"
```
Register the stdio server with an MCP client. `mcp install` merges `mcpServers.aliaster-bot` and leaves other servers in place.
```bash
aliaster mcp stdio --workspace "$HOME/.config/aliaster/demo"
aliaster mcp install --workspace "$HOME/.config/aliaster/demo" \
--agent planner --target /path/to/mcp.json
```
`scripts/package-release.sh` builds a stripped release binary, refuses a binary that is not under 15 MB, and writes `dist/aliaster-1.0.0-dev-<target>.tar.gz` plus a `.sha256` file. It does not create a git tag or a GitHub Release.
An `aliaster-mcp` name on `argv[0]` is `aliaster mcp stdio`.
## Frozen Python package
`src/aliaster` and `pyproject.toml` remain so older tests and the golden database check can run. That tree is frozen. The commands below are the historical install those tests still check. They are not the current product. The Rust commands above are.
Python 3.11+ and pipx are required for that tree. It is not published to PyPI. Install an immutable tag (`master_YYYYMMDD_HHMM`), not a moving branch:
```bash
pipx install 'aliaster[full] @ git+https://github.com/zonzideka/aliaster@master_YYYYMMDD_HHMM'
```
`full` equals `gmail` plus `keyring`. When using the keychain, every platform needs the `keyring` extra.
When the GitHub CLI is already logged in, run `gh auth setup-git` first. The HTTPS URL above then uses gh's credential helper. When using a personal access token, give it to Git's credential helper (`gh auth setup-git` or `git credential`). Do not put the token in the URL.
The historical entry point is `aliaster init`. A template deploy fetches its pin from `https://github.com/zonzideka/aliaster` by default. `--pin-source` is a parameter of `aliaster template deploy` and `aliaster template confirm-and-deploy`. It is not on `aliaster init`. Do not put a token in `--pin-source`.
## Configuration
Copy [identities.example.yaml](identities.example.yaml) only as a commented template, then edit it. Runtime never falls back to that file. [`.env.example`](.env.example) lists variables and leaves every secret empty.
| Name | Role |
|---|---|
| `ALIASTER_CONFIG` | Path to `identities.yaml`. |
| `ALIASTER_CASES` | Path to `cases.db`. |
| `ALIASTER_AGENT` | Trusted principal. It must match `policy.grants`. It is not an agent tool argument. |
| `ALIASTER_DOMAIN_ALLOWLIST` | Comma-separated alias domains. Unset or empty is deny-all. |
| `SIMPLELOGIN_API_KEY` | SimpleLogin API key. Prefer a mode-`0600` file referenced by `credential_files` or `SIMPLELOGIN_API_KEY_FILE`. |
| `GMAIL_OAUTH_TOKEN_PATH` | Path to a Gmail OAuth token file. The token does not belong in YAML. |
`aliaster gmail authorize` writes that token file. `aliaster secrets status` reports whether a secret resolves and never prints the value.
`identities.example.yaml` uses a sample alias domain and the principal `grok-bot`. Replace both with your own before a live workspace. An empty domain allowlist fails closed. There is no baked-in operator domain in `src/`.
Keychain and 1Password `op://` references exist in the secret resolver. The product boot path does not construct the macOS keychain backend and does not call `op`. Credential files are the live backend. See [docs/ROADMAP.md](docs/ROADMAP.md) and [docs/PLAN-1.1.md](docs/PLAN-1.1.md).
## Status and roadmap
Core 1.0 acceptance is recorded in [docs/ACCEPTANCE-1.0.md](docs/ACCEPTANCE-1.0.md): the M6 cutover, one live send (S1), and a same-`request_id` replay (S4). A release tag is not approved. The package version stays `1.0.0-dev`.
Still open or unverified on a live mailbox: `mail.reply_thread`, `mail.search_mail`, `mail.get_thread`, and an allowlist denial. Reply-recipient checks are implemented and covered by tests. They do not yet have a recorded live pass.
The 1.1 plan is a GUI (five screens from the Paper prototype) and a macOS Keychain read path. The keychain type is still never constructed, and switching a live workspace to it needs a separate approval. The full inventory and the decisions behind it are [docs/ROADMAP.md](docs/ROADMAP.md).
## Built with Grok
Aliaster is built and operated with Grok. Grok Build agents write and review changes in this repository. Grok Bot is the first-party agent integration: the template and connector live under [integrations/grokbot](integrations/grokbot), and the example policy grant is the principal `grok-bot`.
## Documentation
- [Changelog](CHANGELOG.md)
- [Roadmap](docs/ROADMAP.md)
- [1.1 plan](docs/PLAN-1.1.md)
- [1.0 acceptance](docs/ACCEPTANCE-1.0.md)
- [Architecture](docs/ARCHITECTURE.md)
- [Agent contract](docs/CONTRACT.md)
- [MCP](docs/MCP.md)
- [Binary update](docs/UPDATE.md)
## License
MIT License. The copyright holder is zonzideka. See [LICENSE](LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues