Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

docs(config-tools): mention dealWriteGuard where the config agent looks first

merged#2923CedarCopilot

CedarCopilot wants to merge 1 commit into staging from worktree-deal-write-guard-tool-descriptions

What Libra verified

  • Config requests to block CRM deal writes surface dealWriteGuard

    Libra ran this behavior against the change and confirmed the check detects when it breaks.

    Technical evidence
    • the account-config routing catalog identifies external-writes when Cedar must block writes to matching CRM deals
    • the apply-config-change tool description points deal-write requests to update_crm_settings and dealWriteGuard
    • the connection-write tool description points deal-write requests to update_crm_settings and dealWriteGuard

    Changed code: SKILL.md.

  • Connection configuration guidance remains within the tool description budget

    Libra ran this behavior against the change and confirmed the check detects when it breaks.

    Technical evidence
    • the connection-write description remains within the enforced 2048-byte limit
    • the connection-write description keeps sync/push switches, dealSyncFilter, and dealWriteGuard available to the agent

    Changed code: connection-write-tool.ts.

  • The config tool explains how to set and clear dealWriteGuard

    Libra ran this behavior against the change and confirmed the check detects when it breaks.

    Technical evidence
    • the apply-config-change description states that dealWriteGuard blocks writes to HubSpot deals matching every field/value pair
    • the apply-config-change description states that clearing uses dealWriteGuard {} with clearDealWriteGuard true

    Changed code: applyConfigChangeTool.ts.

Live on prod, watching, 2 days leftTimeline and evidence
  1. Opened
    Sep 23, 2026, 1:53 PM
  2. Sep 23, 2026, 2:12 PM
  3. Merged
    Sep 23, 2026, 2:40 PM
  4. Live on prod
    Sep 23, 2026, 2:40 PM
  5. Observed 1 hour
    Sep 23, 2026, 2:40 PM
  6. Watching

    Live on prod, watching, 2 days left

    Sep 23, 2026, 2:40 PM

Behaviors Libra is checking

The account configuration agent loads the external-writes guidance when a user asks to block Cedar writes to matching CRM deals with dealWriteGuard.Not checked
prod
The configuration agent can set a dealSyncFilter through update_crm_settings to control which CRM deals are synchronized.Not checked
prod
The configuration agent can clear an existing dealWriteGuard by sending an empty guard together with clearDealWriteGuard=true.Not checked
prod
The configuration agent can set dealWriteGuard through update_crm_settings so writes to HubSpot deals matching every configured field/value pair are blocked.Not checked
prod

Libra has verdicts on 0 of 4 tracked behaviors on prod; 4 are still being checked. Libra checks hourly for 3 days after each deploy.

Summary

  • The config agent's first-read descriptions still called update_crm_settings "sync toggles" and never mentioned dealWriteGuard (#2917), so an agent asked to "stop writing to closed deals" had no reason to look for it. This adds it to the three places the agent reads first:
    • connection-write tool description, item 3 (update_crm_settings): now names the push switches, dealSyncFilter and dealWriteGuard.
    • applyConfigChangeTool tool-level description, item 3: names dealSyncFilter and dealWriteGuard, and how to clear it (dealWriteGuard {} plus clearDealWriteGuard true).
    • The routing catalog entry for external-writes (account-config/index.ts, plus the matching line in the cedar-configuration SKILL.md): adds a second trigger, "before blocking Cedar from writing to certain CRM deals (dealWriteGuard)". Both carve-outs are kept.
  • Two hard budgets shaped the wording. The external-writes description is 396 of the 400-character catalog cap, so I dropped filler words to make room. The connection-write description sits about 48 bytes under the 2048-byte limit Claude Code truncates at (a test pins it), so item 3 grew by 36 bytes.

Test plan

  • pnpm exec vitest run src/mastra/skills/account-config src/mastra/tools/config src/mastra/mcp/external: 33 files / 727 tests pass, including tool-description-length.test.ts (2048-byte limit) and the description-cap test in cedar-configuration-docs.test.ts (400 characters).
  • pnpm --filter @zero/server run types, pnpm dlx oxlint@1.78.0 --deny-warnings, pnpm deps:check and the brand check all pass.
  • Routing suite not yet re-run. Editing a routing description is what that suite guards (docs/design/agent-knowledge-routing-suite.md, 28 cases, live model calls, so it costs money). It will be run after this merges, on the owner's go-ahead, and any red case is a question about the external-writes seam, not an automatic revert.

Verify in prod

Text-only changes. In a chat with the config agent, ask "stop Cedar writing to closed HubSpot deals for this connection": it should reach for connection-write update_crm_settings with dealWriteGuard. Regression signal: an ordinary CRM-field or Slack-sync request that now loads external-writes (the routing suite covers this).

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The documentation-only changes appear safe to merge.

Summary

This PR updates the config agent’s first-read routing and tool descriptions so requests to restrict writes to selected HubSpot deals can discover dealWriteGuard.

  • Adds dealWriteGuard as an external-writes routing trigger.
  • Documents dealSyncFilter, dealWriteGuard, and the explicit guard-clearing payload.
  • Preserves the existing routing carve-outs and documented description-length constraints.

Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'origin/sta..."

Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • apps/server/.claude/skills/cedar-configuration/SKILL.mdno production surface mapped
  • apps/server/src/mastra/skills/account-config/index.tsno production surface mapped
  • apps/server/src/mastra/skills/account-config/tools/applyConfigChangeTool.tsno production surface mapped
  • apps/server/src/mastra/tools/config/connection-write-tool.tsno production surface mapped