mo commited on
Commit
5c5b617
·
1 Parent(s): bf62c9f

docs: enterprise documentation suite — compliance mappings (CRA, ISO 27001, IEC 62443), threat model, data flow, audit & deployment guides, SBOM, use cases, security.txt

Browse files

- new docs/additional-documents/: COMPLIANCE, CRA-READINESS, ISO-27001-MAPPING, IEC-62443, THREAT-MODEL, DATA-FLOW, SECURITY-AUDIT, DEPLOYMENT-GUIDE, ENTERPRISE-FAQ, SBOM
- docs/USE-CASES.md, docs/.well-known/security.txt
- docs index + README link the additional documents section
- CHANGELOG v2.2.0 entry; versions: root 2.2.0, desktop 1.4.1

README.md CHANGED
@@ -195,3 +195,16 @@ MIT — see [LICENSE](LICENSE). Free forever.
195
 
196
  **[mona.expert](https://agent.mona.expert)** — one key, one brain, any
197
  device.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
 
196
  **[mona.expert](https://agent.mona.expert)** — one key, one brain, any
197
  device.
198
+
199
+
200
+ ## Compliance & standards
201
+
202
+ Enterprise-ready documentation: [EU CRA readiness](docs/additional-documents/CRA-READINESS.md),
203
+ [ISO/IEC 27001 mapping](docs/additional-documents/ISO-27001-MAPPING.md),
204
+ [IEC 62443 alignment](docs/additional-documents/IEC-62443.md),
205
+ [threat model](docs/additional-documents/THREAT-MODEL.md),
206
+ [data flow & minimization](docs/additional-documents/DATA-FLOW.md),
207
+ [deployment guide](docs/additional-documents/DEPLOYMENT-GUIDE.md),
208
+ [enterprise FAQ](docs/additional-documents/ENTERPRISE-FAQ.md) and
209
+ [SBOM](docs/additional-documents/SBOM.md).
210
+ See [SECURITY.md](SECURITY.md) for vulnerability reporting.
apps/desktop/package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "mona-agent",
3
- "version": "1.4.0",
4
  "description": "mona.expert device agent — smart terminal, cloud brain. The only credential it holds is the mona.expert key.",
5
  "type": "module",
6
  "private": true,
 
1
  {
2
  "name": "mona-agent",
3
+ "version": "1.4.1",
4
  "description": "mona.expert device agent — smart terminal, cloud brain. The only credential it holds is the mona.expert key.",
5
  "type": "module",
6
  "private": true,
docs/.well-known/security.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ Contact: mailto:mo@mona.expert
2
+ Expires: 2027-01-01T00:00:00.000Z
3
+ Encryption: https://github.com/MONAEXPERT/agent/security/policy
4
+ Policy: https://github.com/MONAEXPERT/agent/blob/main/SECURITY.md
5
+ Preferred-Languages: en, de
6
+ Canonical: https://monaexpert.github.io/agent/.well-known/security.txt
docs/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
  # Changelog
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  All notable changes to the mona-agent client are documented here.
4
  Format: [Keep a Changelog](https://keepachangelog.com), versioning:
5
  [SemVer](https://semver.org).
 
1
  # Changelog
2
 
3
+
4
+ ## v2.2.0
5
+
6
+ - Deep reasoning engine: plan → act → reflect → verify loop with visible
7
+ reasoning at every step
8
+ - Auto brain mode: per-task smart/cheap balancing (step budget, verification,
9
+ provider routing) — simple tasks stay cheap, complex tasks go deep
10
+ - Live debug log, per-run traces with tokens/cost/latency, insights graphs
11
+ - Training export (JSONL) with human feedback ratings
12
+ - Premium plans via the Sngine package framework (limits, plan-aware brains)
13
+ - Compliance documentation suite (CRA, ISO 27001, IEC 62443, GDPR, SBOM)
14
+
15
+
16
  All notable changes to the mona-agent client are documented here.
17
  Format: [Keep a Changelog](https://keepachangelog.com), versioning:
18
  [SemVer](https://semver.org).
docs/USE-CASES.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Cases
2
+
3
+ Concrete scenarios for mona-agent, from personal automation to operations.
4
+
5
+ ## 1. Personal Mac assistant
6
+ Open apps, check system health, run small scripts, control media — from any
7
+ browser, including the phone. The brain decides what to do; the Mac executes.
8
+ - Chat: "How's my disk?" → agent measures and reports with numbers.
9
+ - Chat: "Open Safari and play some Avicii" → apps + browser tools.
10
+
11
+ ## 2. Developer machine automation
12
+ Delegated, audited command execution on a dev box: run tests, check logs,
13
+ restart services — with a full trace of every step for review.
14
+ - Chat: "Run the test suite and summarize failures."
15
+
16
+ ## 3. Home-lab / server operations
17
+ For machines without interactive access: health checks, log tailing, package
18
+ status. No SSH needed from the phone — the device polls the cloud.
19
+ - Chat: "What's the uptime and load of the NAS?"
20
+
21
+ ## 4. Kiosk & presentation machines
22
+ Control long-running GUI programs in the background (media playback, demo
23
+ windows) and restart them on demand.
24
+ - Chat: "Restart the demo window on the kiosk."
25
+
26
+ ## 5. Compliance-heavy environments
27
+ Every action is traced (reasoning → tool call → result → answer →
28
+ verification) with tokens, cost and latency — exportable as JSONL for audits
29
+ and model fine-tuning. See `additional-documents/` for ISO, IEC and CRA
30
+ readiness.
31
+
32
+ ## 6. Model evaluation & training
33
+ Collect real conversation traces with human feedback (Good/Bad ratings) and
34
+ export them as a ready-to-use fine-tuning dataset.
35
+
36
+ ## 7. Multi-device fleets
37
+ One dashboard, many devices — each with its own revocable token and
38
+ telemetry. Start with one Mac, grow to a fleet without changing the model.
docs/additional-documents/COMPLIANCE.md ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Compliance & Standards Readiness
2
+
3
+ mona-agent is the open-source client for the mona.expert cloud. This document
4
+ summarizes how the architecture maps to common compliance frameworks. Detailed
5
+ mappings live in the sibling documents of this folder.
6
+
7
+ Architecture in one paragraph: a lightweight device daemon holds **no secrets
8
+ and no model weights**; it authenticates to the cloud over TLS with a single
9
+ device key, polls for work, receives reasoning decisions from the cloud brain,
10
+ executes tools locally behind an allowlist, and streams results back. All LLM
11
+ provider keys are stored AES-256-GCM encrypted on the server, never on the
12
+ device. Every run is audit-logged with per-step usage, tokens, cost and timing.
13
+
14
+ ## Framework alignment at a glance
15
+
16
+ | Framework | Scope | How mona-agent aligns |
17
+ |---|---|---|
18
+ | **EU CRA** (Cyber Resilience Act) | Products with digital elements | SBOM-ready, signed releases, documented vulnerability handling, secure-by-default device, free security updates for the support window — see `CRA-READINESS.md` |
19
+ | **ISO/IEC 27001** | Information security management | Documented controls mapping (Annex A), crypto, access control, logging, incident handling — see `ISO-27001-MAPPING.md` |
20
+ | **IEC 62443** | OT / industrial automation security | The daemon as an embedded device component: least privilege, no default credentials, integrity checks, patch path — see `IEC-62443.md` |
21
+ | **NIS2 / KRITIS** | Critical infrastructure operators | Operator-side documentation: inventory, incident reporting hooks, supply-chain data |
22
+ | **GDPR** | Personal data | Data minimization (device metrics only), user-scoped data isolation, export & deletion endpoints, encryption at rest for secrets |
23
+ | **SOC 2** (Type II readiness) | Trust services criteria | Audit trail completeness, access controls, change management evidence, availability monitoring |
24
+
25
+ ## Security properties that matter for auditors
26
+
27
+ 1. **No inbound ports on devices.** The daemon polls HTTPS every 2 s. Nothing
28
+ can reach the device from the internet.
29
+ 2. **One key, one brain.** The device key proves device identity; LLM provider
30
+ keys live encrypted on the server and are never shipped to devices.
31
+ 3. **TLS everywhere.** All control and data traffic is HTTPS with certificate
32
+ verification (no TLS bypass, no insecure fallback).
33
+ 4. **Tool sandboxing.** Shell execution runs against an explicit command
34
+ allowlist (blocked by default); file access is confined to a workspace root
35
+ with path-traversal rejection; web access validates URL schemes.
36
+ 5. **Complete audit trail.** Every chat message, brain step, tool call, tool
37
+ result, token count, cost and latency is stored and exportable (JSONL) —
38
+ including per-step reasoning for incident reconstruction.
39
+ 6. **Self-healing operation.** Transient failures retry with backoff, malformed
40
+ brain replies trigger corrective nudges, stranded tasks expire with a
41
+ closing message instead of replaying days later.
42
+ 7. **Rate limiting & plan separation.** Free and Pro plans enforce request
43
+ limits per user and per device.
44
+
45
+ ## Useful reading
46
+
47
+ - `THREAT-MODEL.md` — STRIDE analysis of the cloud-brain architecture
48
+ - `DATA-FLOW.md` — where data lives, moves, and is minimized
49
+ - `SECURITY-AUDIT.md` — self-assessment checklist for adopters
50
+ - `DEPLOYMENT-GUIDE.md` — enterprise rollout (launchd/systemd, proxies, updates)
51
+ - `ENTERPRISE-FAQ.md` — procurement questions and answers
docs/additional-documents/CRA-READINESS.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EU Cyber Resilience Act (CRA) Readiness
2
+
3
+ The Cyber Resilience Act (EU) 2024/2847 imposes cybersecurity requirements on
4
+ products with digital elements sold in the EU. This document maps mona-agent's
5
+ client architecture to the CRA's essential requirements and manufacturer
6
+ obligations.
7
+
8
+ ## Product classification
9
+
10
+ mona-agent (this repository) is **open-source software** distributed free of
11
+ charge as the client for a cloud service. Under CRA Article 3, open-source
12
+ software developed outside a commercial activity is exempt; the commercial
13
+ **cloud service** (mona.expert) is the product with digital elements and the
14
+ obligations below are documented so operators can show readiness end-to-end.
15
+
16
+ ## Essential requirements (Annex I) — how they are met
17
+
18
+ | CRA requirement | Implementation |
19
+ |---|---|
20
+ | Security by design & default | No inbound ports, least-privilege tools, secure defaults, no credentials on devices |
21
+ | No known exploitable vulnerabilities at release | Automated test suite, lint, dependency review; patched releases published on GitHub |
22
+ | Secure default configuration | Allowlist-based shell, workspace-confined file access, URL scheme validation |
23
+ | Protection against unauthorized access | Device key authentication (revocable per device), TLS 1.2+, AES-256-GCM encrypted keys |
24
+ | Data minimization | Only task text, tool results and device metrics leave the device; provider keys never reach devices |
25
+ | Resilience & availability | Self-healing agent loop, retry with backoff, stale-task expiry, metrics-driven health checks |
26
+ | Logging & monitoring | Complete audit trail (messages, brain steps, tool calls, tokens, cost, latency); live event stream |
27
+ | Secure updates | Versioned releases on GitHub; daemon restart applies updates; update notes in CHANGELOG |
28
+
29
+ ## Manufacturer obligations — operational mapping
30
+
31
+ | CRA obligation | Where it happens |
32
+ |---|---|
33
+ | Vulnerability handling process | `SECURITY.md` (reporting, response targets, disclosure policy) + `security.txt` |
34
+ | Vulnerability reporting for components | Dependencies are audited; fixes released within the support window |
35
+ | SBOM (software bill of materials) | `docs/SBOM.md` — inventory of client components and versions |
36
+ | Support window & updates | Client follows semantic versioning with tagged releases; breaking changes documented in CHANGELOG |
37
+ | CE marking & technical documentation | Operator-side; this repository provides the technical documentation basis |
38
+
39
+ ## Incident response & disclosure targets
40
+
41
+ - **Acknowledge** a valid report within 5 working days
42
+ - **Triage & reproduce** within 15 days
43
+ - **Fix or mitigate** within 90 days for high-severity issues
44
+ - **Disclose** publicly after a fix is available (coordinated disclosure)
45
+
46
+ See `SECURITY.md` at the repository root for the full policy and contact.
docs/additional-documents/DATA-FLOW.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Data Flow & Data Minimization
2
+
3
+ This document describes where data lives and moves in a mona-agent
4
+ deployment, for GDPR/DPIA reviews and security assessments.
5
+
6
+ ## Data inventory
7
+
8
+ | Data | Created at | Stored at | Retention |
9
+ |---|---|---|---|
10
+ | User account | Cloud (Sngine) | Cloud DB | Until account deletion |
11
+ | Device token | Cloud, on request | Cloud DB (plain, revocable) + device config | Until revoked |
12
+ | Provider API keys | User input (dashboard) | Cloud DB, AES-256-GCM encrypted | Until deleted |
13
+ | Chat messages | Dashboard / device | Cloud DB | Per-user; delete per agent or factory reset |
14
+ | Run traces (reasoning, tool calls, results) | Device loop | Cloud DB (runs + steps) | Deleted with agent / factory reset |
15
+ | Usage & cost metrics | Every LLM call | Cloud DB | Aggregated for insights; per-run detail deleted with agent |
16
+ | Device telemetry (CPU/mem/disk/uptime) | Device, every 10 s | Cloud DB (latest + rolling history) | Forgotten on "Forget device" |
17
+ | Device files & command output | Device tools | **Stays on the device** except task-relevant results streamed to the cloud for the brain | Ephemeral per run |
18
+
19
+ ## Data flow (one task)
20
+
21
+ 1. User sends a message (dashboard → cloud over TLS).
22
+ 2. Cloud queues the task; the device polls and claims it (outbound HTTPS).
23
+ 3. Device sends context to the cloud brain; the cloud calls the LLM provider
24
+ using the user's key (decrypted in memory only).
25
+ 4. Brain decides tool calls; the device executes them locally and returns
26
+ results to the cloud.
27
+ 5. The cloud stores the conversation, the run trace and usage metrics; the
28
+ dashboard streams the answer to the user.
29
+
30
+ ## Minimization principles
31
+
32
+ - **No secrets on devices.** Provider keys never leave the cloud.
33
+ - **No model weights anywhere in this product.** The product is a control
34
+ plane; the models are third-party APIs.
35
+ - **Telemetry is performance-only** (CPU, memory, disk, uptime, load). No
36
+ keystrokes, no screen capture, no browsing history.
37
+ - **Tool output is truncated** for transport (bounded context) — the full
38
+ output stays on the device unless the task requires it.
39
+
40
+ ## Data subject rights (operator toolkit)
41
+
42
+ - **Export**: per-user training export (JSONL) and audit log access.
43
+ - **Delete**: per-agent deletion, per-user factory reset, device
44
+ telemetry forget, token revocation — all available in the dashboard.
45
+ - **Minimize**: free plan limits bound data volume per account.
docs/additional-documents/DEPLOYMENT-GUIDE.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Enterprise Deployment Guide
2
+
3
+ Production rollout for the mona-agent client on macOS, Linux and Windows.
4
+
5
+ ## 1. Provisioning flow
6
+
7
+ 1. Create the user's account and agent in the dashboard.
8
+ 2. Generate a device token (Settings → Mona key).
9
+ 3. On the device: install Node.js ≥ 20, then
10
+ `curl -fsSL https://agent.mona.expert/install.sh | bash`
11
+ followed by `mona-agent login` with the token.
12
+ 4. Start the daemon. Verify the dashboard shows the device online.
13
+
14
+ ## 2. Persistent service (recommended)
15
+
16
+ **macOS (launchd)** — `~/Library/LaunchAgents/com.mona.agent.plist`:
17
+
18
+ ```xml
19
+ <?xml version="1.0" encoding="UTF-8"?>
20
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
21
+ <plist version="1.0">
22
+ <dict>
23
+ <key>Label</key><string>com.mona.agent</string>
24
+ <key>ProgramArguments</key>
25
+ <array>
26
+ <string>/usr/local/bin/node</string>
27
+ <string>/path/to/agent/apps/desktop/bin/mona-agent.js</string>
28
+ <string>start</string>
29
+ </array>
30
+ <key>RunAtLoad</key><true/>
31
+ <key>KeepAlive</key><true/>
32
+ <key>StandardOutPath</key><string>/tmp/mona-agent.log</string>
33
+ <key>StandardErrorPath</key><string>/tmp/mona-agent.log</string>
34
+ </dict>
35
+ </plist>
36
+ ```
37
+
38
+ Load with `launchctl load ~/Library/LaunchAgents/com.mona.agent.plist`.
39
+
40
+ **Linux (systemd)** — `/etc/systemd/system/mona-agent.service`:
41
+
42
+ ```ini
43
+ [Unit]
44
+ Description=mona-agent device daemon
45
+ After=network-online.target
46
+ Wants=network-online.target
47
+
48
+ [Service]
49
+ Type=simple
50
+ User=mona
51
+ ExecStart=/usr/bin/node /opt/mona-agent/apps/desktop/bin/mona-agent.js start
52
+ Restart=always
53
+ RestartSec=5
54
+ NoNewPrivileges=true
55
+
56
+ [Install]
57
+ WantedBy=multi-user.target
58
+ ```
59
+
60
+ ## 3. Network policy
61
+
62
+ - Outbound: TCP 443 to the cloud endpoint only (the daemon).
63
+ - The cloud makes the LLM provider calls, not the device.
64
+ - No inbound rules. No WebSocket relay required (HTTPS polling fallback).
65
+
66
+ ## 4. Update policy
67
+
68
+ - Track release tags on GitHub; review the CHANGELOG.
69
+ - Rolling update: stop the daemon, update the client directory, start the
70
+ daemon. In-flight tasks expire safely (no replay).
71
+
72
+ ## 5. Hardening checklist
73
+
74
+ - Run the daemon as a dedicated, unprivileged OS user.
75
+ - Restrict the shell allowlist if the device performs sensitive work.
76
+ - Keep the credentials file owner-readable (`chmod 600`).
77
+ - Point logs at your log rotation (launchd/systemd examples above).
78
+ - Monitor the live event stream for `llm:error` and rate-limit events.
79
+
80
+ ## 6. Capacity notes
81
+
82
+ - The daemon is idle-light: polling every 2 s, metrics every 10 s.
83
+ - Reasoning cost is per task and visible in the dashboard (Insights tab).
84
+ - Auto brain mode balances depth against cost per task automatically.
docs/additional-documents/ENTERPRISE-FAQ.md ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Enterprise FAQ
2
+
3
+ Answers to the questions procurement, security and compliance teams ask.
4
+
5
+ **Where do the models run?**
6
+ Reasoning runs in the cloud (agent.mona.expert) through your own LLM provider
7
+ API keys (OpenAI, Anthropic, Google, DeepSeek or OpenRouter). Your devices
8
+ never run models and never hold provider keys.
9
+
10
+ **Does the device open any ports?**
11
+ No. The daemon makes outbound HTTPS connections only and polls for work.
12
+
13
+ **What data leaves my device?**
14
+ The task text, the tool results relevant to the task, and lightweight
15
+ performance metrics (CPU, memory, disk, uptime). No keystrokes, no screen
16
+ capture, no browsing history. Provider keys never leave the cloud.
17
+
18
+ **Where is my data stored?**
19
+ Conversations, run traces and usage metrics are stored server-side, scoped
20
+ per user account. Device telemetry keeps the latest sample plus a short
21
+ rolling history.
22
+
23
+ **Can we delete everything?**
24
+ Yes. Per-agent deletion, per-user factory reset, device telemetry forget and
25
+ token revocation are one-click operations in the dashboard. Data is also
26
+ exportable (JSONL) for audits or model training.
27
+
28
+ **What compliance frameworks do you support?**
29
+ See the documents in this folder: EU CRA readiness, ISO/IEC 27001 control
30
+ mapping, IEC 62443 alignment, GDPR data-flow documentation and a SOC 2
31
+ readiness audit trail. SECURITY.md defines vulnerability handling.
32
+
33
+ **What happens if a device is stolen?**
34
+ Revoke its token in the dashboard; the device loses access immediately.
35
+ Provider keys are unaffected (they were never on the device).
36
+
37
+ **What happens if the cloud is unreachable?**
38
+ The daemon retries with backoff and continues polling; tasks queue and are
39
+ delivered when connectivity returns, or expire with a closing message after
40
+ 10 minutes of a dead device.
41
+
42
+ **Can the agent do something destructive?**
43
+ Tools are allowlisted: shell commands run against an explicit allowlist, file
44
+ access is confined to a workspace with path-traversal protection, and web
45
+ access validates URL schemes. Every action is traced with full arguments and
46
+ results. For high-stakes devices, disable shell entirely.
47
+
48
+ **How much does it cost?**
49
+ The client is open source (MIT). LLM usage is billed by your own provider
50
+ keys; the dashboard shows exact per-run token counts and cost, and an auto
51
+ mode balances reasoning depth against cost per task.
52
+
53
+ **Is there an on-premise option?**
54
+ The client is fully self-contained and connects to the cloud endpoint;
55
+ contact the project for deployment and integration options.
docs/additional-documents/IEC-62443.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IEC 62443 — Industrial Automation Security Alignment
2
+
3
+ IEC 62443 defines security requirements for components used in industrial
4
+ automation and control systems (IACS). The mona-agent daemon can be treated as
5
+ an **embedded device component** (62443-4-2) when deployed on machines that
6
+ participate in industrial workflows (operator consoles, edge gateways, lab
7
+ instruments). This document maps the relevant foundational requirements.
8
+
9
+ ## Component model
10
+
11
+ - **Host application**: the daemon runs as a normal user process on macOS /
12
+ Linux / Windows; it does not require elevated privileges.
13
+ - **External interface**: outbound HTTPS only (polling); no listening sockets.
14
+ - **Credentials**: one revocable device key; stored in the user profile with
15
+ file permissions restricted to the owning account.
16
+
17
+ ## 62443-4-2 foundational requirements
18
+
19
+ | FR | Requirement | Implementation |
20
+ |---|---|---|
21
+ | FR 1 — Identification & authentication | Unique identity per device | Device token, revocable server-side, never reused across devices |
22
+ | FR 2 — Use control | Authorization before execution | Server-side per-user authorization on every call; per-user rate limits |
23
+ | FR 3 — System integrity | Protect against manipulation | TLS with certificate verification; code served from signed Git tags |
24
+ | FR 4 — Data confidentiality | Protect confidentiality | Encrypted transport; provider keys never stored on devices |
25
+ | FR 5 — Restricted data flow | Segment control | Device-initiated connections only; optional egress proxy support |
26
+ | FR 6 — Timely response to events | Audit + response | Full audit trail; live event stream; self-healing loop logs anomalies |
27
+ | FR 7 — Resource availability | DoS resilience | Backoff retries, task expiry, bounded tool output, step budgets |
28
+
29
+ ## Deployment notes for IACS environments
30
+
31
+ 1. **Network segmentation**: place the device in a zone whose egress is
32
+ restricted to the cloud endpoint (HTTPS 443). No inbound rules required.
33
+ 2. **Update policy**: pin releases by Git tag; test in a staging zone before
34
+ rollout; the daemon restarts to apply updates (seconds of downtime).
35
+ 3. **Audit**: retain the platform audit log per your retention policy; export
36
+ it as JSONL for SIEM ingestion.
37
+ 4. **Compensating controls**: for safety-related systems, keep tool access at
38
+ the minimum (disable shell if unused) and require human confirmation for
39
+ irreversible actions via the dashboard.
40
+
41
+ See `DEPLOYMENT-GUIDE.md` for concrete launchd/systemd/proxy configurations.
docs/additional-documents/ISO-27001-MAPPING.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ISO/IEC 27001 Annex A — Control Mapping
2
+
3
+ This mapping supports organizations building an ISMS around the mona-agent
4
+ deployment. "Implemented by mona-agent/platform" means the control exists in
5
+ the product; "operator" means the adopting organization provides it.
6
+
7
+ ## A.5 — Information security policies
8
+ - **A.5.1 Policies for information security** — operator. Templates: this
9
+ repository's security documents are the baseline.
10
+
11
+ ## A.8 — Asset management
12
+ - **A.8.1 Responsibility for assets** — operator assigns owners; the platform
13
+ enumerates assets: users, agents, devices, API keys, tasks, runs.
14
+ - **A.8.2 Information classification** — task content is user-scoped; device
15
+ telemetry is limited to performance metrics.
16
+
17
+ ## A.9 — Access control
18
+ - **A.9.1 Business requirements** — device tokens are per-device, revocable
19
+ (single revoke or revoke-all); dashboard uses Sngine session auth with CSRF
20
+ protection on every state change.
21
+ - **A.9.2 User access management** — one key per device; keys are encrypted
22
+ AES-256-GCM at rest on the server; last-used timestamps for review.
23
+ - **A.9.4 System and application access control** — role separation: device
24
+ (Bearer token) vs dashboard (session) APIs; write operations rate-limited.
25
+
26
+ ## A.10 — Cryptography
27
+ - **A.10.1 Cryptographic controls** — TLS for all transport; AES-256-GCM for
28
+ stored secrets; random token generation (CSPRNG); no custom crypto.
29
+
30
+ ## A.12 — Operations security
31
+ - **A.12.1 Operational procedures** — documented run loop (poll → claim →
32
+ think → act → observe → reflect → answer → verify).
33
+ - **A.12.4 Logging and monitoring** — full audit log (messages, brain steps,
34
+ tool calls, token usage, cost, latency), live event stream, trace endpoint
35
+ per run.
36
+ - **A.12.5 Control of operational software** — versioned, tagged releases;
37
+ update via daemon restart; changelog maintained.
38
+ - **A.12.6 Technical vulnerability management** — SECURITY.md disclosure
39
+ process; dependency reviews; coordinated disclosure.
40
+
41
+ ## A.13 — Communications security
42
+ - **A.13.1 Network security management** — devices initiate all connections
43
+ (no inbound exposure); certificate verification enforced.
44
+
45
+ ## A.14 — System acquisition, development and maintenance
46
+ - **A.14.2 Security in development** — test suite on every change, parser
47
+ fuzzing via unit tests, lint, secure-by-default tool registry.
48
+
49
+ ## A.16 — Information security incident management
50
+ - **A.16.1 Responsibilities and procedures** — incident reconstruction from
51
+ the audit trail and per-run traces; feedback loop documented in SECURITY.md.
52
+
53
+ ## A.17 — Business continuity (information security aspects)
54
+ - **A.17.1 Planning** — operator; the client is stateless: any device can be
55
+ reprovisioned with a new token without re-deploying infrastructure.
56
+
57
+ ## A.18 — Compliance
58
+ - **A.18.1 Legal and contractual** — operator; data export and deletion
59
+ endpoints exist (per-user factory reset, per-agent deletion, JSONL export).
docs/additional-documents/SBOM.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Software Bill of Materials (SBOM)
2
+
3
+ Client-side component inventory for the mona-agent device daemon.
4
+
5
+ ## Runtime dependencies
6
+
7
+ | Component | Version | Purpose | License |
8
+ |---|---|---|---|
9
+ | Node.js (runtime) | ≥ 20 | JavaScript runtime | MIT |
10
+ | ws | ^8.18 | WebSocket client (optional relay) | MIT |
11
+
12
+ The client has exactly **one npm dependency** (`ws`); everything else —
13
+ cloud client, engine protocol, SSE handling, tool registry, TUI — is
14
+ implemented in this repository with Node built-ins.
15
+
16
+ ## Build & toolchain
17
+
18
+ | Component | Purpose |
19
+ |---|---|
20
+ | node:test | Test runner (34+ tests, no external test deps) |
21
+ | npm workspaces | Monorepo layout (packages/engine, packages/protocol, apps/desktop) |
22
+
23
+ ## Server-side (operated by the platform)
24
+
25
+ The cloud side is a PHP application on standard shared hosting (LiteSpeed,
26
+ MySQL/MariaDB, PHP 8.x) plus the Sngine framework for accounts and payments.
27
+ Provider SDKs are not used; LLM calls are plain HTTPS REST. Server components
28
+ are the operator's responsibility and are documented for audits in this
29
+ folder.
30
+
31
+ ## Generating a full SBOM
32
+
33
+ ```bash
34
+ npm ls --all --json > sbom-npm.json
35
+ ```
36
+
37
+ Combine with the Git tag manifest (`git tag`, `CHANGELOG.md`) for a complete
38
+ release inventory.
39
+
40
+ ## Vulnerability monitoring
41
+
42
+ - `npm audit` on the single dependency per release
43
+ - GitHub Security advisories for the repository
44
+ - SECURITY.md reporting path for external findings
docs/additional-documents/SECURITY-AUDIT.md ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Security Self-Audit Guide
2
+
3
+ A practical checklist for teams adopting mona-agent. Each item states what to
4
+ verify and where the evidence lives.
5
+
6
+ ## 1. Device provisioning
7
+
8
+ - [ ] Device token generated from the dashboard (Settings → Mona key), never
9
+ hardcoded, never committed to version control.
10
+ - [ ] `mona-agent login` performed on the device; credentials file readable
11
+ only by the owning user (`chmod 600`).
12
+ - [ ] Device inventory matches reality: one token per device, labels in use.
13
+
14
+ ## 2. Network posture
15
+
16
+ - [ ] No inbound ports required or opened for the daemon.
17
+ - [ ] Egress limited to `https://agent.mona.expert` (and the LLM providers,
18
+ which the *cloud* calls — the device never talks to providers).
19
+ - [ ] Corporate proxy/MITM inspection excluded for the cloud endpoint
20
+ (certificate verification is enforced).
21
+
22
+ ## 3. Secrets & keys
23
+
24
+ - [ ] Provider keys stored only via the dashboard (encrypted AES-256-GCM).
25
+ - [ ] Keys rotated on personnel change; last-used timestamps reviewed
26
+ periodically.
27
+ - [ ] Device tokens revoked immediately on device loss (single-click).
28
+
29
+ ## 4. Tool policy
30
+
31
+ - [ ] Shell allowlist reviewed (blocked commands stay blocked).
32
+ - [ ] For high-stakes devices: tools reduced to the minimum set; irreversible
33
+ actions require human confirmation in the dashboard.
34
+
35
+ ## 5. Monitoring & incident response
36
+
37
+ - [ ] Live log reviewed (Logs tab) or exported for SIEM ingestion.
38
+ - [ ] Retention period defined for audit data.
39
+ - [ ] Incident reconstruction drill: open a run trace and confirm the full
40
+ chain (reasoning → tool call → result → answer → verification) is
41
+ readable end-to-end.
42
+
43
+ ## 6. Updates
44
+
45
+ - [ ] Release tags pinned; changelog reviewed before rollout.
46
+ - [ ] Staging device tests a new version before fleet rollout.
47
+
48
+ ## Evidence matrix
49
+
50
+ | Control | Evidence |
51
+ |---|---|
52
+ | Authentication | Settings → Devices: token list with last-used |
53
+ | Authorization | Rate-limit events in the live log; plan limits in Settings → Plan |
54
+ | Integrity | Git tags; test suite in CI; dependency list (see `SBOM.md`) |
55
+ | Confidentiality | Key storage is encrypted server-side; devices hold no provider keys |
56
+ | Auditability | History tab, run traces, JSONL training export, live event stream |
docs/additional-documents/THREAT-MODEL.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Threat Model (STRIDE)
2
+
3
+ Scope: the mona-agent client (device daemon) and its communication with the
4
+ mona.expert cloud. The LLM providers (OpenAI, Anthropic, Google, DeepSeek,
5
+ OpenRouter) are third parties; their trust assumptions are stated explicitly.
6
+
7
+ ## Assets
8
+
9
+ 1. **Device control** — the ability to execute tools on the user's machine.
10
+ 2. **Conversation content** — task text, reasoning, tool results, answers.
11
+ 3. **Provider API keys** — stored encrypted on the cloud, used server-side.
12
+ 4. **Device token** — the daemon's identity credential (on the device).
13
+ 5. **Audit trail** — logs, traces, usage and cost data.
14
+
15
+ ## Trust boundaries
16
+
17
+ - **Browser ↔ Cloud**: HTTPS, session auth + CSRF tokens.
18
+ - **Device ↔ Cloud**: HTTPS, Bearer device token; device initiates.
19
+ - **Cloud ↔ LLM provider**: HTTPS, per-user provider keys, decrypted only
20
+ server-side at call time.
21
+
22
+ ## STRIDE analysis
23
+
24
+ | Threat | Example | Mitigation |
25
+ |---|---|---|
26
+ | **Spoofing** | Attacker impersonates the device or the user | Device tokens are CSPRNG-generated and revocable; session auth with CSRF on writes; TLS certificate verification |
27
+ | **Tampering** | Intercept/modify task or results in transit | TLS 1.2+ everywhere; no plaintext fallback; integrity via Git-tagged releases |
28
+ | **Repudiation** | "The agent deleted the file, not me" | Complete audit trail per run: reasoning steps, tool calls with arguments, results, tokens, cost, latency |
29
+ | **Information disclosure** | Key leak from device, logs, or backup | Provider keys never sent to devices; AES-256-GCM at rest; secrets excluded from logs; per-user data scoping |
30
+ | **Denial of service** | Flood the cloud or the device | Per-user rate limits; plan-based limits; task expiry; step budgets; bounded tool output |
31
+ | **Elevation of privilege** | Prompt injection escalates a tool call | Tool allowlists (shell command allowlist, path-traversal rejection, URL scheme validation); the brain cannot grant itself new tools |
32
+
33
+ ## Residual risks (accepted)
34
+
35
+ - **The cloud brain is an LLM**: a sufficiently creative prompt may produce an
36
+ undesirable *allowed* action. Mitigated by allowlists, explicit background
37
+ mode for long-running programs, and human-visible traces — but not
38
+ eliminated. For high-stakes devices, restrict the tool set and keep a human
39
+ in the loop.
40
+ - **Third-party providers**: conversation content is sent to the chosen LLM
41
+ provider under the operator's own provider account terms.
42
+ - **Physical device access**: an attacker with OS-level access to the device
43
+ can read the device token; revoke tokens immediately after device loss.
44
+
45
+ ## Abuse scenarios reviewed
46
+
47
+ 1. Malicious user sends a task that attempts shell command injection →
48
+ blocked by the command allowlist.
49
+ 2. Brain returns malformed JSON repeatedly → corrective nudges, then a safe
50
+ final answer (no raw JSON leaks to the user).
51
+ 3. Device goes offline mid-task → task expires with a closing message; no
52
+ silent replay.
53
+ 4. Stolen device token → server-side revocation kills the device connection.
docs/index.md CHANGED
@@ -19,3 +19,23 @@ Open-source cloud-brained AI agent for your device — macOS, Linux, WSL2.
19
 
20
  **Cloud:** [agent.mona.expert](https://agent.mona.expert) ·
21
  **Repo:** [MONAEXPERT/agent](https://github.com/MONAEXPERT/agent)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  **Cloud:** [agent.mona.expert](https://agent.mona.expert) ·
21
  **Repo:** [MONAEXPERT/agent](https://github.com/MONAEXPERT/agent)
22
+
23
+
24
+ ## Additional Documents
25
+
26
+ Enterprise and compliance documentation (ISO, IEC, CRA, GDPR):
27
+
28
+ - [Compliance overview](additional-documents/COMPLIANCE.md)
29
+ - [EU Cyber Resilience Act readiness](additional-documents/CRA-READINESS.md)
30
+ - [ISO/IEC 27001 control mapping](additional-documents/ISO-27001-MAPPING.md)
31
+ - [IEC 62443 alignment](additional-documents/IEC-62443.md)
32
+ - [Threat model (STRIDE)](additional-documents/THREAT-MODEL.md)
33
+ - [Data flow & minimization](additional-documents/DATA-FLOW.md)
34
+ - [Security self-audit guide](additional-documents/SECURITY-AUDIT.md)
35
+ - [Enterprise deployment guide](additional-documents/DEPLOYMENT-GUIDE.md)
36
+ - [Enterprise FAQ](additional-documents/ENTERPRISE-FAQ.md)
37
+ - [Software bill of materials](additional-documents/SBOM.md)
38
+
39
+ More content:
40
+
41
+ - [Use cases](USE-CASES.md)
package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "mona-expert",
3
- "version": "2.1.0",
4
  "description": "mona-agent — cloud-brained AI agent for your device. Open-source client: device daemon, terminal UI, local tools. Connects to the mona.expert cloud (agent.mona.expert).",
5
  "type": "module",
6
  "private": true,
 
1
  {
2
  "name": "mona-expert",
3
+ "version": "2.2.0",
4
  "description": "mona-agent — cloud-brained AI agent for your device. Open-source client: device daemon, terminal UI, local tools. Connects to the mona.expert cloud (agent.mona.expert).",
5
  "type": "module",
6
  "private": true,