Support/How-To Do This/How to build CrewOS

How-To Do This

How to build CrewOS

Build a governed team of specialized AI operators with shared records, approval boundaries, and replayable execution evidence.

Pattern
AI agent workforce
First release
One agent, one approved action
Build surface
Developer Console

CrewOS is a ai agent workforce pattern. This guide turns the product concept into a buildable first release using BuildWithHQ records, pages, workflows, permissions, integrations, AI, and exact-version packaging.

Define the outcome before the screens

Give each agent a narrow job, permitted context, declared tools, and a measurable handoff. The product is successful when a person can see what the agent learned, approve or refuse its proposed work, and reconstruct what happened afterward.

Note

Treat every name in this blueprint as a starting point. Use the language of the industry you are serving, but preserve clear ownership, status, permission, and audit boundaries.

1. Create the smallest useful data model

In the Developer Console, create or select the SaaS app and model these as application record types and relationships. The page editor composes React components and validated data bindings, which call the platform APIs for these records.

Record typeWhat it holds
Agent profileRole, instructions, enabled tools, authority ceiling, owner, and active version.
Work requestGoal, requester, priority, source record, current state, and due time.
Suggestion batchThe plan produced from one activity version and its supporting context.
Action suggestionA proposed narrow operation, inputs, risk, evidence, and approval state.
Action executionThe authorized operation, executor, result, correlation ID, and failure evidence.
RatingHuman outcome, quality score, correction, and reusable feedback.

Relationship rule: Relate every request to its source business records; keep suggestions, approvals, executions, and ratings as an unbroken chain.

2. Build the working screens

Start with task-oriented pages instead of a page for every table. The first navigation should contain:

  • Mission control with agent availability and bounded queue health.
  • Work-request detail with source context and plan.
  • Approval queue showing evidence, risk, and exact proposed changes.
  • Execution timeline and failure evidence.
  • Ratings and outcome review by agent/version.

Use Puck for the normal visual experience. Keep stable block identity when using Monaco advanced JSON mode so future template upgrades can merge safely.

3. Set access before adding automation

  • Separate who may request work, inspect context, approve an action, and operate agents.
  • Apply the source record's normal DataRole, field, and location rules to agent context.
  • Set explicit authority ceilings for customer-facing, financial, destructive, and external actions.

User Type menus establish eligible page routes for each audience. They do not grant the records or actions on those pages. The server derives the account, SaaS app, user, DataRole, and location scope from the verified identity on every data request.

4. Add the core workflows

  • Request → read-only planning → suggestion batch.
  • Suggestion → policy check → approval or refusal.
  • Approved suggestion → deterministic queued execution → recorded result.
  • Material source activity change → mark the old plan stale and require preparation again.
  • Completed work → human rating → versioned improvement input.

Make each mutation a narrow, reviewed action with explicit inputs, allowed states, correlation evidence, and an idempotent retry policy where retries are possible. Pages, integrations, and agents all reach the same application service and stored-procedure contract through supported APIs.

5. Connect channels and outside systems

  • Expose only declared, action-specific APIs as agent tools.
  • Route external calls through managed connections or appliance endpoints.
  • Send approval and failure attention to Universal Inbox without moving the source record into the inbox.

Use managed connections, OAuth connectors, inbound endpoints, and webhooks. Put specialized SDKs or private processing behind a declared appliance endpoint; never expose provider credentials to a page.

6. Add AI as a governed layer

Use GoClaw as the planner/worker and the canonical suggestion/execution contracts as the boundary between reasoning and mutations. Agent memory may assist retrieval, but it does not replace application records or authorization.

  • Start with read-only retrieval against one record family.
  • Require structured suggestions with evidence and expected current state.
  • Preserve the Inbox ActivityVersion fence through preparation, approval, and execution.
  • Evaluate exact harness/agent versions and retain ratings by version.

AI and retrieval must apply CanAiReadRecords, tenant, DataRole, field, and location security before context is assembled. Planning and research remain read-only. Customer-facing or material changes use an action suggestion and the configured policy or human approval before execution.

7. Ship one complete vertical slice

Recommended first release: A research agent reads one permitted account, prepares a follow-up task, and an authorized person approves task creation. A changed source activity invalidates the pending suggestion.

  1. Create the minimum record types and seed representative, non-production data.
  2. Build the primary list/queue and one complete detail page.
  3. Implement one state-changing workflow and its denial/error states.
  4. Add the narrowest useful integration or inbound channel.
  5. Add one permission-aware AI read or suggestion only if it improves that workflow.
  6. Test as an owner, a normal operator, a restricted user, and an unauthorized user.

8. Validate, package, and operate

  • Prove an unauthorized agent cannot retrieve the record.
  • Prove refused and stale suggestions cannot execute.
  • Retry execution without producing duplicate work.
  • Trace request, approval, tool call, and result by correlation ID.

Publish a reviewed exact version as a template when the pattern is reusable. If you sell it, complete the marketplace preparation checks. Template installs are version snapshots; upstream edits must never silently mutate a tenant copy.

Built-in data path: React components and data bindings call authenticated APIs; typed application services execute reviewed stored procedures and return bounded results with audit and correlation evidence.

Tip

A useful first agent removes one recurring preparation step. Add more roles only after its permissions, approvals, and outcome measurements are trustworthy.