Skip to content

Enforce rules ​

Ask your agent:

Add a rule that only orders calls outside systems.

It adds the rule to wiremap/model.txt and runs wiremap check, which fails on every edge that breaks it. In the bookshop, shipping calls the carrier:

wiremap/model.txt:7: shipping call carrier breaks `rule no call to any external except from orders` (line 34)
  at services/shipping/src/main/java/bookshop/shipping/CarrierClient.java | URI.create(config.carrierUrl()) (wiremap/evidence.txt:13)
  at deploy/shipping.env | CARRIER_URL=https://api.carrier.example.com (wiremap/evidence.txt:14)
1 problem

The viewer draws an edge that breaks a rule in the warning colour, and names the rule in the panel of either of its nodes:

Change the code, or, since shipping needs the carrier, ask for an exception:

Allow shipping to call the carrier.

TIP

Rules belong to your team: the agent adds, changes or removes one only when you ask, and otherwise reports the edges that break them.

More examples ​

Ask your agentIt writes
Only orders may write to the orders database.rule no write to orders-db except from orders
Nothing in fulfilment calls checkout.rule no call from group fulfilment to group checkout
Nothing but orders reaches the payment provider.rule no edge to payment-provider except from orders

What the agent writes ​

The bookshop's rules after these two requests, at the end of wiremap/model.txt:

rule no call to any external except from orders except from shipping to carrier
rule no edge to payment-provider except from orders
rule no write to orders-db except from orders

A rule names the kinds of edges it forbids, and can narrow them by source, target and exceptions: the model specification has the syntax.