grok-bot-architecture
MCP-native multi-agent architecture with desktop agents and human-in-the-loop gates
Grok Bot quick path · Agnostic quick start · Architecture · FAQ · Contributing · Sponsor An independent, MIT-licensed reference architecture for organizing AI agent teams with reusable agent skills, MCP connectors, and human-in-the-loop (HITL) approval. Start with a chief-of-staff and scoped specialists, then use typed handoffs and persisted approval requests to coordinate work across local and remote hosts. Designed for engineers and operators structuring persistent AI teammates without granting unchecked ambient authority.
Summary extracted from the README.
Grok Bot Architecture: AI Agent Teams, Skills, MCP & Human Approval
A reference architecture for AI agent teams with scoped roles, typed handoffs, and human approval before privileged actions.
Grok Bot quick path · Agnostic quick start · Architecture · FAQ · Contributing · Sponsor
An independent, MIT-licensed reference architecture for organizing AI agent teams with reusable agent skills, MCP connectors, and human-in-the-loop (HITL) approval. Start with a chief-of-staff and scoped specialists, then use typed handoffs and persisted approval requests to coordinate work across local and remote hosts.
Designed for engineers and operators structuring persistent AI teammates without granting unchecked ambient authority. The reference is model- and framework-independent; it is not affiliated with xAI or Cursor and does not contain the Grok Bot product's source code.
How it works
Why this exists
Grok Bot quick path (start in 10 minutes)
To try this pattern on Grok Bot:
- Follow the 10-step setup: Create your coordinator and specialist Bots with paste-ready hard rules, a budgeted routine example, and a first approval stop (grok-bot/SETUP.md).
- Install skills & kickoffs: Load the nine role skills via Cursor plugin or direct paste (install guide) and use the full role kickoffs (kickoff prompts).
- Configure approval policy: Map the four repository gates to personal Auto Review rules (approval policy).
- Run the walkthrough & read the incident case study: Follow an end-to-end task (Grok Bot walkthrough) and see why routines require budgets and fail-closed stops (sanitized case study).
(See the verification report for what has been observed on a live Grok Bot account versus documented from official product facts).
Agnostic quick start
Validate contract fixtures and run the local reference approval lifecycle:
git clone https://github.com/tiagovilasboas/grok-bot-architecture.git
cd grok-bot-architecture
bash scripts/check.sh
No external packages, credentials, or API keys are required. The check exercises JSON validators, Markdown board validation, plugin packaging rules, documentation coherence, link checks, and 31 runtime and board unit tests.
Check individual handoff or interrupt records, or inspect and validate a Markdown board:
node scripts/validate-handoff.mjs /path/to/handoff.json
node scripts/validate-interrupt.mjs /path/to/interrupt.json
node scripts/board.mjs list --file examples/board.example.md
node scripts/board.mjs check --file examples/board.example.md
These checkers validate file shapes; they do not authenticate human approvers or execute side effects. Read the agnostic walkthrough for a general task lifecycle or the repository self-audit case study for a real walkthrough backed by this repository's commit history.
When this architecture helps
Use it when several jobs share infrastructure and their context, credentials, or write permissions need different boundaries: for example, inbox triage alongside engineering and publishing.
Start with a coordinator and one specialist. Add another role only when a concrete boundary justifies it. For one person working on one repository with one tool set, a single agent may be sufficient.
Use the decision guide before adding coordination.
Architecture
Chief-of-staff coordinates five other Core team roles and three optional Domain specialists. Each role loads its own skill and works through scoped host permissions. Shared state carries assignments and evidence; privileged actions require an authenticated decision bound to the action and revision. Isolated code workers return review artifacts through Engineering.
See architecture and trust boundaries and the host integration contract.
Roles: jobs, deliverables, and boundaries
Each role's head is also available as a standalone SVG that you can reuse as an agent avatar.
My reference setup uses two groups: Core team (coordination and cross-cutting work) and optional Domain specialists (finance, product and hobby work). They are a menu to adapt, not a requirement to activate all nine agents.
| Role | Day-to-day job | Expected deliverable |
|---|---|---|
| Chief-of-staff | Turn goals into scoped assignments, prioritize the next increment, dispatch an owner, and review completion. | Assignment card, acceptance decision, blockers and concise next action. |
| Engineering | Implement scoped code and configuration changes, maintain CI, and package branches and pull requests for review. | Reviewable diff, required checks, implementation notes and residual risks. |
| Publishing | Improve public-facing READMEs, documentation, repository presentation, profiles and technical articles. | Source-backed draft or preview, checked links and clear publication status. |
| Security | Review application security and technical privacy within an explicitly authorized scope. | Evidence-backed findings with locations and remediation, or an explicit no-finding result. |
| Inbox | Review bounded batches of inbound messages and scheduling items, prioritize attention, and prepare drafts. | Digest, source references, proposed dispositions, replies and calendar proposals. |
| Career | Screen opportunities against supplied preferences, assess fit and prepare truthful tailored applications. | Ranked shortlist, requirement gaps, source links and application drafts. |
| Finance | Own finance-application requirements and reconcile authorized records into traceable drafts. | Requirements, reconciled totals, assumptions, discrepancy list and review references. |
| Product | Turn one application's user problems into prioritized increments, acceptance criteria and preview reviews. | Problem statement, scoped plan, implementation handoff and validation notes. |
| Hobby | Research discretionary interests, compare offers and explain value, availability and uncertainty. | Comparable shortlist with sources, dates, condition and total-price assumptions. |
Expand a role for its working contract. Full procedures live in the linked skill; the host enforces its actual permissions.
- Job: Turn goals into scoped assignments, prioritize the next increment, dispatch an owner, and review completion.
- Required context: User goal; existing authorization; constraints; board state; relevant specialist evidence.
- Delivers: Assignment card, acceptance decision, blockers and concise next action.
- Boundary: Do not become the default coder, publisher, or mailbox operator. Do not infer broad tool rights from the coordinator role.
- Done when: Every task has one owner; acceptance cites evidence; authority and outstanding blockers are explicit.
Example: “Choose the next documentation improvement and route it to the right specialist.”
Load the Chief-of-staff skill.
- Job: Implement scoped code and configuration changes, maintain CI, and package branches and pull requests for review.
- Required context: Repository instructions; clean/dirty state; target behavior; authorized files and branch; acceptance criteria.
- Delivers: Reviewable diff, required checks, implementation notes and residual risks.
- Boundary: Commit as the actual contributor using repository policy. Do not force push, merge to default, tag, deploy, or change secrets without applicable authority. Bound external contributions by operator policy.
- Done when: Acceptance criteria are verified; checks are reported honestly; no unrelated edits or invented test results.
Example: “Fix the failing validation case and prepare a reviewable PR.”
- Job: Improve public-facing READMEs, documentation, repository presentation, profiles and technical articles.
- Required context: Audience; intended action; source material; verified project behavior; approved public scope.
- Delivers: Source-backed draft or preview, checked links and clear publication status.
- Boundary: Public publishing, profile mutation, default-branch merge, and outbound promotion require applicable authorization. Never invent stars, adoption, certifications, or savings.
- Done when: A new reader can explain what the project does, try the documented path, understand its limits, and identify the license.
Example: “Rewrite the project introduction so a new contributor can understand and try it.”
- Job: Review application security and technical privacy within an explicitly authorized scope.
- Required context: Explicit review scope; authorized systems; code/configuration evidence; threat model; data classification.
- Delivers: Evidence-backed findings with locations and remediation, or an explicit no-finding result.
- Boundary: No exploitation against live targets, disclosure of secrets, production mitigation, or destructive validation without specific authority. Technical privacy review is not legal certification.
- Done when: Every confirmed finding has evidence; no invented identifiers or vulnerabilities; no pressure to manufacture findings.
Example: “Check whether this approval flow lets an agent authorize its own action.”
- Job: Review bounded batches of inbound messages and scheduling items, prioritize attention, and prepare drafts.
- Required context: Authorized sources and date/filter window; priority criteria; batch limit; per-source read/label/draft permissions.
- Delivers: Digest, source references, proposed dispositions, replies and calendar proposals.
- Boundary: The human handles login, MFA, QR approval, and recovery. Never collect credentials in a board. Sending, invitations, or schedule changes require applicable authority.
- Done when: Every reviewed item has a disposition; deadlines are source-backed; no unsolicited send or private-body dump.
Example: “Review the authorized inbox window and draft replies to items needing a response.”
- Job: Screen opportunities against supplied preferences, assess fit and prepare truthful tailored applications.
- Required context: User-supplied constraints and approved professional facts; source listings; location/time-zone preferences; batch limits.
- Delivers: Ranked shortlist, requirement gaps, source links and application drafts.
- Boundary: No bulk applications by default. Submission, recruiter contact, profile changes, and interview scheduling require authority. Never invent experience or promise selection outcomes.
- Done when: Every recommendation maps to user criteria; professional claims are verifiable; drafts are not represented as submitted.
Example: “Compare these roles against my stated constraints and prepare one application draft.”
- Job: Own finance-application requirements and reconcile authorized records into traceable drafts.
- Required context: Authorized data sources; currency/period; reconciliation rules; product scope; permitted reads and drafts.
- Delivers: Requirements, reconciled totals, assumptions, discrepancy list and review references.
- Boundary: Payments, transfers, tax filing, bank access changes, and production writes require scoped authority. Keep financial and household data out of public examples.
- Done when: Totals are reproducible; assumptions and missing evidence are explicit; drafts never imply a completed transaction.
Example: “Reconcile this fictional expense export and flag missing or duplicate entries.”
- Job: Turn one application's user problems into prioritized increments, acceptance criteria and preview reviews.
- Required context: Target users; evidence of a problem; application boundary; constraints; current backlog; success criteria.
- Delivers: Problem statement, scoped plan, implementation handoff and validation notes.
- Boundary: No unsupervised peer spawning. Publication, production changes, or default-branch merge follow host authorization. Do not invent user research or product metrics.
- Done when: The increment addresses an evidenced problem; scope is bounded; acceptance can be reviewed independently.
Example: “Define the smallest useful improvement to this onboarding flow and review the preview.”
- Job: Research discretionary interests, compare offers and explain value, availability and uncertainty.
- Required context: User preferences; authorized research sources; budget/currency; location only when necessary; acceptable uncertainty.
- Delivers: Comparable shortlist with sources, dates, condition and total-price assumptions.
- Boundary: Purchase, bid, reservation, seller messaging, and disclosure of delivery/payment information require authority. No urgency claims without evidence.
- Done when: Options are comparable; prices are qualified; source uncertainty is visible; no purchase is implied.
Example: “Compare these collectible listings against the supplied budget and preferences.”
Use the full role contracts, handoff format, and approval records to adapt these jobs. Roles describe responsibilities; they do not create credential isolation, grant access, or replace a human authorization.
Contract guarantees and limits
| Check | Current behavior | Host responsibility |
|---|---|---|
| Handoff structure | Requires an owner, goal, completion condition, references, and a recognized write-policy shape | Resolve roles, references, and actual tool permissions |
| Approval record | Validator checks record shape; runtime spike binds a decision to an action digest and host-supplied identity | Authenticate and authorize the approver; enforce revision preconditions at the point of the side effect |
| Timeout declaration | Requires default_on_timeout: wait |
Actually pause execution and preserve state |
| Resume replay | Spike serializes calls in one runtime instance and consumes an approved record before execution | Use transactional storage or connector idempotency across processes and crashes |
| Lifecycle persistence | Spike stores local JSON records and recovers ambiguous execution as outcome_unknown |
Protect records and use a concurrency-safe durable store |
| References | Requires an array of non-empty strings | Enforce allowed reference schemes, access, and data minimization |
| Remote work | Documents isolated code work and review handoff | Isolate credentials, files, processes, and network access |
The JSON checkers validate individual records. They do not implement a workflow engine or authenticate identities. The runtime spike exercises only a bounded local lifecycle; it is not a production authorization boundary and does not guarantee safe concurrent execution across processes.
Approval runtime spike
The runtime roadmap tracks the next step beyond record validation. The local reference example demonstrates persisted approval state, a host-supplied human identity, approval bound to an exact action revision, fail-closed cancellation and expiry, and one-shot resume within one runtime instance.
It is an educational host-conformance example, not a production runtime or security boundary. Its local file store is single-process; authentication, resource authorization, multi-process transactions, connector idempotency, and reconciliation remain responsibilities of a consuming host. The example does not call a model or perform a real external side effect.
Documentation
| Start here | What you get |
|---|---|
| Architecture | Layers, ownership, and trust boundaries |
| ADRs | Seven accepted decisions and one proposed runtime spike |
| Grok Bot walkthrough | From skill install to an approval stop on Grok Bot |
| Repository self-audit case study | Real multi-PR audit walkthrough verified in git history |
| Agnostic walkthrough | A complete fictional task lifecycle |
| Host integration | What an adapter must enforce |
| Grok Bot host mapping | What Grok Bot enforces and what stays a convention |
| Grok Bot approval policy | Map repository gates to Auto Review Ask first rules |
| Approval runtime example | Local host-conformance lifecycle spike |
| Runtime roadmap | Current spike, limits, and ordered follow-up tasks |
| Customize your setup | Adapt roles, skills, tools, routines and policies |
| Agent contributor instructions | Shared repository workflow; Claude entry point in CLAUDE.md |
| First week | Adopt a small crew progressively |
| Failure modes | Context waste, excess delegation, and silent approval |
| Connectors | MCP/API boundaries and least privilege |
| Security design | Untrusted inputs and privileged operations |
| Context engineering | References, budgets, and bounded context |
Grok Bot questions
What is Grok Bot?
The official Grok Bot overview describes persistent AI teammates that work across connected apps and a shared computer. This repository is an independent architecture reference for organizing that kind of work. Product installation, pricing, and account support belong in the official documentation.
Is this an open-source Grok Bot implementation?
This reference architecture, its nine role skills, and its local validators are open source under MIT. They are not the Grok Bot service, its backend, an official SDK, or a reverse-engineered implementation.
How do I organize a Grok Bot team?
Start with Chief-of-staff plus the specialist needed for one task. Define its scope, references, permitted actions, and completion criteria. Use the nine role contracts and skill library as recipes; map them to the host's supported tools and approval mechanisms.
Can I use the agent skills with another model or framework?
Yes. The files are portable instructions and contracts. Adapt tool names, state storage, and skill loading to your host. Compatibility with a specific host needs verification; copying a skill does not install an integration or enforce permissions.
Do separate bots isolate secrets and tool access?
Role names alone do not create isolation. The host must enforce permissions and data boundaries. On a shared computer, review which files, credentials, and sessions each bot can actually reach. See host integration and the Grok Bot FAQ.
More questions: Grok Bot skills, MCP, routines, and approval FAQ.
Contribute and get help
Start with CONTRIBUTING.md. Small documentation fixes, anonymized adoption reports, and missing negative fixtures are useful contributions. Propose architecture changes through an ADR; use branches and pull requests.
- Report a bug or improve the docs
- Support and Code of Conduct
- Report a security concern privately
- Changes and follow-up priorities
Stars and forks indicate interest, not verified production adoption. The repository does not publish measured productivity, security, or cost improvements without supporting evidence.
Support the project
If this reference saves you time, sponsoring helps fund maintenance, new host mappings, and runtime work. Starring the repository also helps others find it.
License
MIT License, copyright © 2026 Tiago Vilas Boas. You may use, modify, and redistribute the project, including commercially, under the license terms.
Maintained by Tiago Vilas Boas. Contributions are welcome from any agent ecosystem.
Orbi, the project mascot · original artwork inspired by the Grok Bot visual style · not affiliated with xAI Back to top