Casimir: the CPC pilot how-to

What works today, and how to demonstrate it

This is the Capacity rehearsal, not a CPC tenant installation. Octopus runs the application services; Hamster supplies HTTPS through SWAG. Microsoft operates Teams/Entra and file storage. Obot.ai runs the approved demo Microsoft connectors. The Obot.ai Microsoft intermediary must be replaced before CPC production.

A personal Teams request generated a German invitation containing KASTANIE from the brief and an approved synthetic MCP guide. The model received no identity JWT or Microsoft OAuth credentials. Model failure stops drafting without a template substitute.

WorkflowVerified resultRemaining boundary
Teams draftReal model-generated personal replyNo publishing or file creation
Web approvalExact reviewed text to synthetic sinkRequester approves own job; externalSend=false
Direct Obot ExcelWorksheet created; six rows written/readExisting workbook was created through OneDrive UI
Teams workbook linkNew source candidate onlyConfigured owner-only URL; live acceptance pending
CPC rolloutNo CPC grants claimedTenant, owners, hosting and approvals to agree

Expectations for future CPC AI integration

Expected outcomes compared with the verified Capacity rehearsal. These are CPC targets, not completed CPC integrations.

AreaExpected outcomeLab today / gap
Employee interfaceTeams requests; fewer logins and transfersTeams drafts live. File tools still use Obot separately.
Central administrationIT owns connectors, credentials and accessLocal Obot running. CPC tenancy and SSO are not set up.
Access controlBroker enforces user, tool and action rightsRole/resource checks tested. Direct M365 path is separate.
Private contextOne Casimir identity; separate user contextPrivate broker jobs tested. Two-user M365 isolation pending.
Useful workflowsMarketing, tasks, reports, docs; later finance/HRDraft and Excel-write demos. Tasks, finance and HR absent.
Human controlKenzie reviews drafts and approves writesExact dry-run approval tested. Kenzie flow not integrated.
Reliable automationCompany-run reports reach Teams or emailNo recurring delivery yet. Octopus must remain available.
Operational supportRecovery, updates, logs and named ownersSQLite copy checked. Full service / Obot recovery pending.
AdoptionSmall pilot, examples, training, then expandDemo and guide ready. Pilot users and training to agree.

CPC replacement map and startup gate

Mike/CPC IT first confirms the tenant, andreas.petersson@cpc.com, MFA, Teams availability, permanent app owners, runtime and pilot membership. Copy the prototype into a CPC-owned environment. Never copy Capacity credentials.

On a fresh checkout only, npm run bootstrap creates random lab keys and .env. It also seeds the Capacity client and URL: replace those values after bootstrap, before startup. Existing .env is protected against overwrite.

LocationCPC value / decisionOwner / verification
.envENTRA_CLIENT_ID, PUBLIC_URL; fresh workload/bootstrap keysCPC IT; inspect non-secret /api/config
config/policy.jsonCPC tenant, pilot object IDs, roles/resources, new versionIT + business data owner
Teams manifest/runtime fileCPC bot ID, URLs, personal scope and bot secretIT; install and receive personal reply
Compose + SWAGLAN binds, hostnames, HTTPS upstreams, volumes and isolated backendRuntime owner; public health/routing checks
Inference + connectorsApproved endpoint/model, credentials and resource IDsIT/data owner; real draft and allowed/denied tool checks
Document-link configurationCPC resource, owner, HTTPS file URL and host validationData owner; candidate code needs CPC adaptation

Provider, secret files and runtime prerequisites

config/inference.json selects provider, baseUrl, model, output limit and timeout for the OpenAI-compatible chat endpoint. Earlier local MLX generation used an existing Octopus process outside Compose; fresh Compose does not provision it. DeepSeek is now active and authenticated for the Capacity rehearsal.

For a credentialed provider, create .secrets/llm-runtime.env with LLM_API_KEY. The broker optional env_file wiring is now validated. A key in .env alone is insufficient unless passed into the broker. Endpoint/model edits hot-apply because config is read per request; credential changes require docker compose up -d --no-deps --force-recreate broker.

Required fileContents / setupCustodian
.envFresh workload/demo/bootstrap keys and CPC app/URLCPC runtime owner
.secrets/teams-runtime.envTEAMS_CLIENT_ID and TEAMS_CLIENT_SECRETCPC bot owner
.secrets/obot-encryption.yamlVetted Obot v0.26 EncryptionConfiguration with new AES-GCM keyIT key custodian; separate recovery copy
.secrets/llm-runtime.envLLM_API_KEY only when approved provider needs itModel-service owner

Sources: [10], [19], [20], [21]

Human control: the Kenzie workflow

The current web lab binds approval to the exact input hash, requester, policy version and ten-minute expiry. It writes only to a synthetic sink. A requester approves their own private job; Kenzie cannot currently approve another user's job merely by having a reviewer role.

CPC target: requester supplies brief and destination; Casimir prepares the draft/change; Kenzie reviews the exact version and returns changes or approves; the permitted adapter executes once; Teams returns a receipt and the actual resource link. Mike and the business owner must name Kenzie's Microsoft account, review scope and replacement reviewer.

GateCPC targetAcceptance
Review visibilityKenzie sees only assigned review payloadsSeparate requester/reviewer accounts; unrelated private jobs remain hidden
RevisionChanges create a new exact versionPrevious approval cannot authorize edited text, destination or arguments
ApprovalExplicit confirmation of exact writeButton disabled unchecked; denied after expiry or policy change
ExecutionUser/resource authority checked againOne write on replay; receipt names destination and result

Microsoft files: the exact remaining integration

Personal Excel/OneDrive OAuth is complete in Capacity. The consent showed Acorn Labs Integrations, an unverified publisher, with organization-wide delegated offline_access, User.Read, Files.ReadWrite and Files.ReadWrite.All. Actions use each signed-in user's existing rights; this is not CPC consent or app-only access to every tenant file.

Managed vMCP vmcp1rmdls exposes six Excel list/read/worksheet/row/column tools and four read-only OneDrive tools. Delete and sharing tools are excluded. A blank workbook was created through authenticated OneDrive UI; Excel MCP created a worksheet, wrote six synthetic rows and read them back.

The chosen vendor MCPs do not expose new-workbook create/upload. Teams-to-file completion therefore needs a create/upload adapter, user-bound upstream credentials, typed folder/workbook/action rules, reviewed writes and a returned file link. Direct Obot writes remain a separate path.

Sources: [11], [12], [13], [14], [15]

Register an MCP, then authorize a broker workflow

An Obot connection and a broker capability are two registration steps. Adding an MCP URL, package or CLI definition does not automatically authorize a Teams action. Begin with one synthetic resource and a read operation.

Sources: [11], [14]

Planned resources, credentials and owners

These are proposed registration examples, not connected CPC systems. For every connector, name the upstream account/resource, credential custodian, allowed tools, business reviewer and rollback owner before the first write.

ServiceResource and credential boundaryOwner / first reviewed workflow
WordPressNamed site and allowed page/post IDs; dedicated user capabilities and approved application credentialWebsite owner; read content, draft exact diff, take backup/revision point, approve then apply and verify
ShopifyNamed store and resource IDs; installed app with only the approved Admin API scopesStore owner; read-first, review product/content diff and export/backup point before any write
Amazon sellingSeller/Vendor account, marketplace and approved SP-API roles; selling-partner authorizationMarketplace owner; start with read/reporting. Seller Central/SP-API access is separate from AWS account access
Call reportsNamed call/report source and approved records; separate connector and access decisionReport owner; agree collection, allowed recipients and retention. No automatic call ingestion or delivery is implemented

Sources: [16], [17], [18]

Acceptance with outcomes and named owners

Mike assigns an owner and evidence record for each gate below. Existing 14 live smoke checks use loopback synthetic personas; they are not two real CPC/Microsoft users. Do not mark a planned workflow passed from a unit test or successful OAuth alone.

CheckExpected resultOwner / evidence
IdentityCPC pilot succeeds; wrong tenant/non-pilot deniedIT; real sign-in and personal Teams checks
Two usersB cannot read A's private job, approval or unshared workbookIT + data owner; two real connections
Human approvalUnchecked/changed/expired/cross-user/replayed request cannot cause unintended writeKenzie/business owner; reviewed version + receipt
Provider failureNo template, substituted draft or publicationModel/runtime owner; live failure and recovery
File workflowApproved resource written once; link opens for intended owner; read-back matchesData owner; actual Teams-to-file evidence
RevocationRemoving pilot/connector/consent removes intended accessIT; before/after access result
Restart/recoveryJobs persist; uncertain writes reconciled; clean-host restore usableRuntime/key owners; recovery log
Scheduled deliveryApproved recipient receives one report with personal VM offReport owner; schedule/run/delivery receipt

Operations, backup and clean-host recovery

The broker stores durable SQLite WAL jobs and audit metadata. A tested consistent snapshot was opened read-only in a network-isolated container with integrity OK, 13 jobs and 4 synthetic publications. Restart preserved state. This is database-copy evidence, not a full clean-host application or Obot recovery.

An executing job becomes unknown on restart. Pause real writers and reconcile against upstream receipts before replaying it. The current prototype is not a production queue worker and does not automatically resume every queued job.

Sources: [10]

Mike: what the lab actually needed

Most engineering work can be delegated through ownership of Casimir's specific app registrations. Mike can retain CPC tenant consent, Teams rollout and data approvals. The lab was built in capacity.at as andreas@capacity.at; it is not a permission grant in CPC.

The single-tenant web app uses delegated access_as_user for its own API and has no runtime Microsoft Graph permissions; default User.Read was removed. The Teams bot is personal-chat only, with no manifest resource-specific permissions or file support. A German Teams invitation containing KASTANIE was verified with the approved synthetic MCP guide and real local MLX generation. Teams SSO is absent.

Setup tooling is a separate authority: Teams CLI 3.0.3 requests AppDefinitions.ReadWrite from Teams Developer Portal and delegated Graph Application.ReadWrite.All for secret creation and app inspection. Its doctor report demonstrates that a Graph token was available. This is not a Graph permission on the Casimir runtime app. When and by whom the CLI grant was consented has not been verified.

Obot currently uses a local Owner account. Native Entra login and its directory reads have not been granted. Docker administration on Octopus and SSH root access for hamster SWAG were used; Obot's Docker socket can control the host daemon. Earlier Teams generation used Octopus MLX Serve outside Compose (Qwen3.8-Flash-Next-Abliterated-MLX-Serve-mixed-4-8bit). The latest probe timed out; DeepSeek awaits a validated key. Only the brief and synthetic guide reach inference, not identity JWTs or Microsoft OAuth credentials; the template generator and fallback were removed.

The broker matrix is explicit code/configuration, currently binding the verified Capacity user to pilot, marketing, reviewer and operator roles. Sensitive payroll, employee-creation, shell, credential and mail tools are denied. Publication is a synthetic dry run. CPC group integration is proposed, not configured.

Sources: [5], [6]

A practical delegation to Andreas

Use andreas.petersson@cpc.com. Mike creates the agreed registrations, keeps a permanent CPC owner and makes Andreas owner of only those registrations. App ownership includes credential changes, so it is sensitive. Add ownership of the corresponding enterprise apps separately only if Andreas needs to manage pilot assignments.

If ordinary users cannot create registrations, a temporary Application Developer role enables creation as owner. It is a privileged role and also enables certain self-consent. Cloud Application Administrator and Application Administrator manage applications broadly across the tenant; they are not the default requirement for this pilot. Application Administrator also covers Application Proxy.

Mike or another CPC Cloud Application Administrator/Application Administrator can approve tenant-wide delegated consent. Graph application permissions require Privileged Role Administrator or a suitably authorized custom role. Registration ownership alone does not confer tenant-wide consent authority.

Andreas can develop and upload the personal Teams app when his custom-upload setup policy allows it. Mike/Teams Administrator retains app availability and organization rollout. Manage pilot availability through the tenant's app-centric management or existing app-permission policies. A normal pilot security-group owner can manage membership, but cannot approve OAuth scopes.

Enterprise-app/service-principal ownership can allow assignment administration. Group-based enterprise-app assignment needs Entra P1/P2; verify CPC licensing or use individual assignments. Data owners share only the dedicated test workbook/folder. File sharing and consent are separate gates.

Mike-led alternative: Mike performs portal setup and creates/seeds bot credentials in CPC's secret store; Andreas provides exact names, redirects, endpoints, scopes, manifest and user list, then handles code and deployment. This avoids giving Andreas a broad administrator role or approving a new broad CLI grant.

Sources: [1], [2], [3], [4], [7], [8]

Microsoft tools: approvals and remaining work

For the Capacity demo, Andreas approved Obot.ai as the Excel/OneDrive intermediary, with replacement required later. Microsoft displayed Acorn Labs Integrations, an unverified publisher, and Consent on behalf of your organization was checked. The rights map to offline_access, Files.ReadWrite, Files.ReadWrite.All and User.Read. Admin/discovery and personal runtime OAuth completed for both Excel and OneDrive. OneDrive drive listing succeeded and Excel workbook listing succeeded with a null result. Excel MCP created a worksheet, wrote six synthetic rows and read them back. Two-user isolation remains untested.

This is organization-wide delegated consent, not app-only access to every tenant file. Actions still use an authenticated user's rights, including shared files. It is broader than an Andreas-only grant and is not CPC approval. Managed vMCP vmcp1rmdls exposes six Excel list/read/worksheet/row/column tools and four OneDrive read tools; delete and sharing tools are disabled. The final Entra grant and app ID still need inventory.

The direct Obot Microsoft playground and typed broker workflows are separate paths today. Direct Excel writes do not inherit the broker's marketing approval or resource rules. CPC implementation must integrate per-user credentials, tool and workbook/folder authorization, review of writes and revocation. Keep deletion and file-sharing changes disabled until reviewed.

Native Obot Entra login is another decision. Current v0.26 documentation lists delegated User.Read and ProfilePhoto.Read.All plus application GroupMember.Read.All and User.Read.All for directory/group lookup. None of those additional Obot directory grants exists in this local-owner lab. Mike should review them separately; Community registration or Enterprise licensing is also required for Entra login.

The handoff should record each app/tool's owner, permissions by type, consent actor, publisher, destination and expiry. CPC owns identities, pilot membership, upstream file access, data-processing approvals, secrets and rotation. Replacing the vendor endpoint requires repeating the OAuth and isolation tests.

Sources: [4], [9], [10], [11], [12], [13]

Verification boundary

modelProvider: Earlier local MLX broker/Teams generation is verified. The latest local synthetic probe timed out after about 20 seconds and the broker reported TimeoutError. A replacement provider is pending; activation requires fresh successful probe, broker and Teams evidence.

teamsDocumentLink: Source candidate: configured owner-only workbook link. Do not claim live delivery until a new Teams request and denial checks are recorded.

recovery: Copied consistent SQLite snapshot opened read-only without network; integrity OK, 13 jobs and 4 synthetic publications. Full service/clean-host recovery is not yet verified.

Today’s Teams prompt and draft flow

Today’s Teams prompt and draft flow

Capacity controls the adapter, broker policy, approved context and private state on Octopus; Microsoft operates Teams and Entra. Only approved prompt data reaches inference. The current draft path does not create Microsoft files.

Select the diagram for its full-size image.

Microsoft files and credential boundaries

Microsoft files and credential boundaries

Direct Obot worksheet creation, six-row write and read-back succeeded on a UI-created blank workbook. User/file owners govern access. Direct writes bypass broker review; Teams file creation and two-real-user isolation remain pending.

Select the diagram for its full-size image.

CPC rollout ownership and resource access

CPC rollout ownership and resource access

Proposed: Mike/CPC IT owns tenant consent, hosting, keys and model decisions; business owners define resources/review; Andreas implements through agreed named-app ownership. CPC has granted no access in this rehearsal.

Select the diagram for its full-size image.

WordPress, Shopify and Amazon connections

WordPress, Shopify and Amazon connections

Planned registration path: reviewed MCP endpoint/package, upstream credential owner, selected tools and pilot access profile. A separate typed broker adapter/schema plus role/resource policy is required before Teams may invoke it.

Select the diagram for its full-size image.

A reviewed CLI through Casimir

A reviewed CLI through Casimir

The verified lab inspection uses fixed executable/argv and bounded output. Future CLIs need packaged dependencies, reviewed user/service credentials and explicit resource guards. Arbitrary shell remains denied.

Select the diagram for its full-size image.

Primary references and evidence

Official sources support the guide. Lab evidence and open acceptance gates are recorded separately.

  1. Microsoft Entra: delegate app administration
  2. Microsoft Entra: Application Developer role
  3. Microsoft Entra: assign enterprise-app users/groups
  4. Microsoft Entra: grant tenant-wide admin consent
  5. Microsoft Graph: Application.ReadWrite.All permission
  6. Microsoft Graph: application addPassword
  7. Microsoft Teams: custom app policies and settings
  8. Microsoft Teams: app-centric management
  9. Obot: Entra authentication provider
  10. Obot: encryption providers
  11. Obot: MCP access policies
  12. Obot catalog: Microsoft Excel connector
  13. Obot catalog: Microsoft OneDrive connector
  14. Obot: virtual MCPs
  15. Obot: Microsoft Office 365 MCP source
  16. WordPress: REST API authentication
  17. Shopify: API access scopes
  18. Amazon: selling-partner application authorization
  19. Obot: custom encryption provider configuration
  20. DeepSeek: model/pricing reference
  21. DeepSeek: thinking mode