More Progress on Agentic AI Code Gen in §Blawx

Early results using AI agents to write Blawx code

March 29, 2026

I have been working on improving the AI-assisted §Blawx code generation features, and the progress is extremely encouraging.

As an experiment, I took the text of the rules that I encoded for the G7 GovAI challenge, and had an AI Agent take a shot at creating the vocabulary and the encodings for all of the sections.

I'm going to share those results with you because I think they are exciting, but not because I think they are good enough. This is an early promising result, but not at all an indication of how strong we can make it.

The Text

For the G7 example I included excerpts of three rules.

Financial Admininstration Act

Regulations respecting conditions under which contracts awarded
41   (1) The Governor in Council may make regulations with respect to the conditions under which contracts may be entered into and, notwithstanding any other Act of Parliament,
    (a) may direct that no contract by the terms of which payments are required in excess of such amount or amounts as the Governor in Council may prescribe shall be entered into or have any force or effect unless entry into the contract has been approved by the Governor in Council or the Treasury Board; and
    (b) may make regulations with respect to the security to be given to and in the name of Her Majesty to secure the due performance of contracts.
  Exception
  (2) Subsection (1) does not apply in respect of Crown corporations, the Canada Revenue Agency or the Invest in Canada Hub.

Government Contracts Regulations

Bids
5. Before any contract is entered into, the contracting authority shall solicit bids therefor in the manner prescribed by section 7.
6. Notwithstanding section 5, a contracting authority may enter into a contract without soliciting bids where
  (a) the need is one of pressing emergency in which delay would be injurious to the public interest;
  (b) the estimated expenditure does not exceed
    (i) in the case of a goods contract, $25,000,
    (ii) in the case of a contract to be entered into by the Minister for International Development for the acquisition of architectural, engineering or other services required in respect of the planning, design, preparation or supervision of an international development assistance program or project, $100,000,
    (iii) in the case of a contract for the acquisition of architectural, engineering or other services required in respect of the planning, design, preparation or supervision of the construction, repair, renovation or restoration of a work, $100,000, and
    (iv) in the case of any other contract to which these Regulations apply, $40,000;
  (c) the nature of the work to be contracted for is such that it would not be in the public interest to solicit bids; or
  (d) only one person is capable of performing the contract.

Directive on the Management of Procurement

Contracting approvals
4.6 Contracting authorities are responsible for the following:
  4.6.1 Seeking Treasury Board approval when the estimated value for a contract or contractual arrangement, including taxes, expected amendments, and follow-on contract or contractual arrangement, exceeds the limits in Appendix A: Contracting Approvals:
    4.6.1.1 Prior to entering into or amending a contract or contractual arrangement;
    4.6.1.2 Prior to amending a contract or contractual arrangement if the procurement deliverables or costs change after advance approval; and
    4.6.1.3 Prior to entering or amending a contract issued against an acquisition instrument (for example, standing offer or supply arrangement) when the estimated value exceeds the limits specified in the Treasury Board–approved acquisition instrument;
A.1 Basic contracting limits
A contract or contractual arrangement may be entered into without the approval of the Treasury Board, if the amount payable, including all applicable taxes, fees and amendments, does not exceed the stated limit in Canadian dollars for the contracting authority identified in the basic limits schedules. [abbreviated]
  Schedule 3: Services
    Department, Competitive, Non-competitive
    National Defence $7,500,000 $375,000
    All other departments $3,750,000 $200,000

The Prompt

I gave the following prompt to GitHub CoPilot using GPT-5.4:

Please connect to the Blawx server and look at the rules included in the current project. Proceeding one section of a rule at a time, adhering to the best practices in the guide documentation, encode and test using questions and fact scenarios each section until all the substantive sections of the rules have been encoded.

What the Agent Did

Here's a brief summary of what the agent did, over the course of approximately 15 minutes, using 217 calls to Blawx:

  1. Checked the Blawx server health
  2. Read some documentation on the Blawx MCP server
  3. Read the contents of the (empty) project, and the text of the rules.
  4. Read more of the documentation on the MCP server
  5. Tried creating a category
  6. Tried creating a relationship
  7. Read more documentation
  8. Created some ontology for one section
  9. Did an encoding of that section
  10. Created a question and a fact scenario to test that section of code
  11. Ran the question, determined that it had not used the vocabulary properly because the natural language explanation was difficult to read
  12. Corrected the NLG parameters on the category and relationships
  13. Repeated the ontology, encoding, facts, question, test, repair flow in the next section
  14. Ran into issues with numeric comparisons, found a workaround, and implemented it
  15. Ran into an error with a fact scenario it wanted to create, implemented a simpler one instead.

What the Agent Wrote

If you'd like to take a look at the actual output in detail, get in touch with me on the Slack, and I'll send it to you. What follows is a short summary.

Vocabulary - Categories

  • Contract - A government contract
  • Contracting Authority - An authority that enters into contracts
  • Contract Kind - A category of contract for GCR section 6 thresholds
  • Department - A department for Treasury Board contracting limits
  • Procurement Approach - A competitive or non-competitive procurement approach
  • Crown Corporation - A Crown corporation excluded from FAA subsection 41(1)

Vocabulary - Relationships

  • Must Solicit Bids For - An authority must solicit bids before entering a contract
  • Contracting Authority For - Identifies the contracting authority for a contract
  • May Enter Without Soliciting Bids - A contracting authority may enter into a contract without soliciting bids
  • Pressing Emergency Need - The need is one of pressing emergency
  • Estimated Expenditure - The estimated expenditure for the contract
  • GCR Section 6 Condition Satisfied - A section 6 condition is satisfied for the contract
  • Contract Kind Of - The contract kind of a contract
  • GCR Section 6 Threshold - The threshold amount for a GCR section 6 contract kind
  • Not In Public Interest To Solicit Bids - It would not be in the public interest to solicit bids
  • Delay Would Be Injurious To Public Interest - Delay would be injurious to the public interest
  • Only One Person Capable Of Performing - Only one person is capable of performing the contract
  • GCR Section 6 Applicable Threshold - The applicable GCR section 6 threshold for a contract
  • Estimated Expenditure Within GCR Section 6 Threshold - The estimated expenditure is within the applicable GCR section 6 threshold
  • Authority Department - The department associated with a contracting authority
  • Treasury Board Limit - The Treasury Board limit for a department and procurement approach
  • Appendix A Limit For - The Appendix A limit applicable to a contract
  • Procurement Costs Changed After Advance Approval - Procurement costs changed after advance approval
  • Treasury Board Approval Required For - Treasury Board approval is required for the contract
  • Procurement Approach Of - The procurement approach used for a contract
  • Total Estimated Value - The total estimated value for DMP approval analysis
  • Treasury Board Approval Not Required For - Treasury Board approval is not required for the contract
  • Acquisition Instrument Limit - The Treasury Board approved acquisition instrument limit for the contract
  • Procurement Deliverables Changed After Advance Approval - Procurement deliverables changed after advance approval
  • Issued Against Acquisition Instrument - The contract was issued against an acquisition instrument
  • DMP 4.6.1 Condition Satisfied - A DMP 4.6.1 condition is satisfied for the contract
  • Has Advance Approval - The contract already has advance approval
  • DMP Appendix A Limit Exceeded - The contract value exceeds the applicable Appendix A limit
  • Acquisition Instrument Limit Exceeded - The contract value exceeds the approved acquisition instrument limit
  • Governor In Council Prescribed Amount - The amount prescribed by the Governor in Council
  • FAA 41 1 Does Not Apply To - FAA subsection 41(1) does not apply to the authority
  • FAA 41 1 a Approval Required For - The contract requires approval under FAA subsection 41(1)(a)
  • FAA 41 1 a Amount Exceeded - The contract payments exceed the prescribed amount
  • Governor In Council May Make Regulations Respecting Contract Security - The Governor in Council may make regulations respecting contract security
  • Contract Payments Required - Payments required by the terms of the contract

Fact Scenarios

  • GCR Section 6 Paragraph D Scenario
  • GCR Section 6 Paragraph B Below Threshold Scenario
  • GCR Section 6 Paragraph B Equal Threshold Scenario
  • FAA Named Excluded Authority Scenario
  • GCR Section 5 Positive Scenario
  • GCR Section 6 Threshold Baseline
  • GCR Section 6 Paragraph C Scenario
  • GCR Section 6 Paragraph A Scenario
  • DMP Appendix A Not Required Scenario
  • DMP Advance Approval Change Scenario
  • DMP Appendix A Required Scenario
  • DMP Acquisition Instrument Limit Scenario
  • FAA Approval Required Scenario

Questions

  • FAA 41 1 Exclusions
  • FAA 41 1 b Security Regulation Power
  • FAA 41 1 a Approval Required
  • GCR Section 5 Must Solicit Bids
  • GCR Section 6 Thresholds
  • GCR Section 6 Permission
  • GCR Section 6 Condition
  • DMP Treasury Board Limits
  • DMP Treasury Board Approval Required
  • DMP Treasury Board Approval Not Required

Encodings

These are the encodings it generated for the GCR document, as they appeared inside §Blawx.

GCR s. 5

gcr s5

GCR s. 6

gcr s6

GCR s. 6(a)

gcr 6a

GCR s. 6(b)

gcr 6b

This section was re-written in order to work around an issue it was having using less-than-or-equal to, which is the reason for the complexity.

GCR s. 6(b)(i)

gcr 6bi

GCR s. 6(b)(ii)

gcr 6bii

GCR s. 6(b)(iii)

gcr 6biii

GCR s. 6(b)(iv)

gcr 6biv

GCR s. 6(c)

gcr 6c

GCR s. 6(d)

gcr 6d

An Example Question Run

Here is an example of what I got when I ran the GCR Section 5 Must Solicit Bids question against the GCR Section 5 Positive Scenario fact scenario:

The Question

Blawx code reading "Is it true that: [Authority] must solicit bids for [Contract]"

The Fact Scenario

An encoding of a fact scenario in Blawx that reads "We know [pspc] is the contracting authority for [office_supplies_contract]"

The Result

A question result page in blawx showing a tree-structured explanation why "pspc must solicit bids for office_supplies_contract"

OK, fine, but So What?

The biggest obstacle to the use of symbolic AI in law is the knowledge acquisition bottleneck - it is hard and expensive to get people who understand symbolic AI and law to collaborate on useful encodings.

If we could solve that problem, we open up an enormous range of possibilities for trustworthy legal automation.

The biggest opportunity to solve the knowledge acquisition bottleneck is a user interface that both an agentic generative AI and non-programmer subject matter experts can use, collaboratively.

§Blawx is an attempt at building that interface, and now for the first time I can show that threshold coding agents, with only an MCP server, are quite proficient at using it for generating and testing encodings.

The encodings it created are dramatically better than any AI-generated §Blawx code I have seen before. The agent is correctly using the validation features of the tool to discover and fix errors in the encoding as it goes, using the documentation when it runs into problems it doesn't know how to solve, and more. The vocabulary choices are solid, it is following the steering set out by the MCP server... it is all very impressive.

Expect a New Blawx Code Generation Feature Soon

Given how far I have gotten, and how quickly, I am now very confident that there is a version of this agentic coding approach that can be productively deployed in §Blawx, likely before the end of May, and that it will dramatically reduce the time to a first testable encoding.

There is a lot work to be done, still. But a couple of months of Saturday mornings should get us to a release of a version of §Blawx with an agentic code generator. Later, the workflow involved in getting the agent's help, and the UI for observing what it is doing are going to need to be improved. No current guess for how long that's going to take, yet, but stay tuned.