Skip to main content
Use pcl-assertion-workflow to create and test an assertion project in your protocol repository.

Prerequisites

  • Completed the AI agent setup
  • pcl installed
  • A Foundry-based protocol repository
  • Agreed policy requirements and review responsibilities

1. Start the agent in the protocol repository

Give the agent access to the repository that contains the protocol contracts. Do not give it deployment credentials for this task; project creation and testing are local operations. Ask it to inspect the existing Foundry configuration, dependency layout, contracts, tests, and policy or invariant documentation before proposing changes.

2. Request the project

Use a prompt like this:

3. Review the proposed policy checks

Before allowing implementation, confirm that each proposed assertion:
  • Protects a security-relevant property
  • Uses the state, calls, or logs needed to check the policy, with explicit observation boundaries
  • Adds coverage beyond checks already enforced by the protocol
  • Names the contracts and state transitions it covers
  • Has a narrow trigger strategy
  • Can be exercised by both passing and failing tests
If a policy requirement is ambiguous, refine it before the agent writes Solidity.

4. Review the generated project

Follow the host repository structure. A typical project contains:
The agent may also update foundry.toml, remappings.txt, or dependency files. Review those changes for overlap with existing profiles and remappings.

5. Verify the project

Give the agent this verification prompt:
Review the test output and ask the agent to summarize:
  • Which assertion functions executed
  • Which protected calls were tested
  • How each negative test proves the assertion invalidates a transaction
  • Any policy requirement or execution path that remains untested
Passing tests do not prove that the chosen policy is correct or complete. Review the assertion logic and threat model before moving to deployment.

6. Prepare for deployment

Review the implementation and test evidence against your requirements. Before deployment:
  • Commit or otherwise preserve the reviewed local changes
  • Confirm that assertions/credible.toml names every protected contract and assertion
  • Decide on the Alerting or Production environment
  • Choose the target network for the release: record its name and chain ID, platform URL, and RPC endpoint
  • Identify the Protocol Manager wallet for that network; assign it after platform project creation and before release creation
Carry the network choice into the deployment request. For a new project, pass the selected chain ID through pcl deploy --chain-id <chain-id>. For an existing project, the CLI reads its chain from the platform; verify that the project belongs to the network you selected. A platform login and the Alerting/Production environment are separate from choosing the project’s chain. Before creating the release, ask the agent to confirm:
Continue with Deploy Policies with an AI Agent.