Skip to content

Contracts

Contracts are instructions attached to nodes that tell AI agents how to implement them. They’re more precise than descriptions — they’re checkable rules.

Properties the implementation must have. Each expect item has a pass/fail checkbox:

  • Passed — the implementation satisfies this requirement
  • Failed — the implementation doesn’t meet this yet
  • Unchecked — hasn’t been verified

For example:

  • “Passwords are hashed with bcrypt, min 12 rounds”
  • “Rate limit: 5 login attempts per minute per IP”
  • “JWT tokens expire after 1 hour”

Expect items are the gate for the Verified status — a node can only be marked “verified” when every expect item has passed.

Questions or confirmations the agent should ask before implementing. Use these for decisions that need human input — “Which OAuth provider?”, “PostgreSQL or MySQL?”, “Should this be async?”

Anti-patterns to avoid. Hard rules about what the implementation must not do — “Never mock the database in integration tests”, “Never use any types”, “Never call this endpoint without authentication.”

On the canvas, nodes with contracts show a small badge with icons and counts:

1/311

The shield icon shows expect items (green if all pass, red if any fail, gray if unchecked). The message icon shows ask items. The ban icon shows never items.

Contracts flow down the hierarchy. If a system has an expect rule “All APIs must return JSON”, every container, component, and operation inside that system inherits it. When an AI agent requests a task via get_task, it receives the full chain of inherited contracts.

This means you can set project-wide rules at the system level and detailed implementation rules at the component level.

Select a node and scroll to the Contract section in the Properties panel. Click the + button in any section (Expect, Ask, Never) to add a new item. Type your rule and press Enter.

For expect items, click the checkbox to toggle passed/failed/unchecked state.

Expect items can include an image — useful for UI mockups, API response examples, or reference screenshots. Click the image button on an expect item to upload. Images are stored inline in the model file (base64, resized to max 1280px).