Ecosystem

ActQL Toolscoming soon

Turn an agent's unpredictable operations into a program that can be checked.

ActQL is an open-source engine. An AI agent reads data from SaaS and databases, asks an LLM to judge it and writes the result back. In ActQL you write that whole flow as one SQL program and run it.

The engine checks every program before running it, whether a person or an agent wrote it.

Who it is for

  • Your agent reads and writes external SaaS and databases, and you worry that it will do something you did not expect.
  • You want a person to see what will change, and approve it, before the agent changes any data.
  • You want to build an agent into a customer-facing product, but giving it broad permissions or a place to run any code it likes is too risky.

Example program

Say the meeting notes for each deal are in Google Drive and the deals themselves are in Salesforce. This program reads the notes for each deal, asks an LLM whether the stage or the next step has changed, and updates Salesforce only for the deals that changed.

SELECT o.id AS id, o.StageName, o.NextStep,
       c.content AS notes
FROM salesforce.opportunities AS o
JOIN drive.files AS f ON f.name = o.name
JOIN drive.contents AS c USING (resource, version)
|> INFER `model-task:deal-review.v1`
     INPUT (StageName, NextStep, notes) AS review
|> WHERE review.outcome = 'ok' AND review.value.changed
|> RESULT updates
|> EFFECT UPDATE salesforce.Opportunity
     ID id SET (
       StageName = review.value.stage,
       NextStep = review.value.next_step
     );

INFER calls an LLM and gets back a value of a fixed type. EFFECT writes to an external system.

With ordinary tool calls, such as function calling, the agent picks its next operation each time it fetches a piece of data. You cannot tell which operations will run until they have run.

With this program, what it reads, which data the LLM gets and where the result goes are all fixed before the run.

Four things that change with ActQL

  1. The scope of operations is fixed beforehand: the LLM returns a value of the declared type and cannot add operations during the run.
  2. Checks and approval come in two stages: the engine checks the program before it runs, and just before the write a person can see exactly what will change and approve it.
  3. The run history reads as one story: ActQL stores the data it read, the LLM's answers, the approvals and the outcome of each write, linked to one another.
  4. The engine takes over the tedious parts: matching data, calling the LLM and confirming whether a write went through.

How it works on this page explains each of these. For the design of ActQL as a whole, see the top page.

What you can try today (the preview)

  • The developer preview published today (v0.0.2) runs the deal-review example on this page from start to finish against mocks, with no credentials. It stops before the write, you approve, and you check the result. There is a TypeScript/Node library and a CLI, and no Python version yet.
  • ActQL does not yet generate tool definitions from a program's types, and there is no MCP server. For now you wrap the SDK call as a tool yourself.

If you would like to try the stable release when it is out, sign up for the newsletter. We send release news by email.


How it works

The obstacle to handing work to an AI agent is that you cannot predict what it will do. Malicious instructions can hide in the data (prompt injection), and the LLM can return something wrong (hallucination). With ordinary tool calls, the agent may then rewrite or delete data in ways nobody expected.

ActQL limits the scope of operations with a program, and checks and approves before anything is written.

How is the scope of operations limited?

During a run, ActQL performs only the reads and writes that the program contains. In the example above the LLM judges the stage and the next step of each deal, but it can return only a value of the type declared beforehand. Its answer cannot make ActQL write to another system that the program does not mention.

The same holds when the agent writes the program itself. The engine checks the program before running it, and does not execute connections or operations that the Host's configuration does not allow. Whoever runs the engine decides how much to allow, not the agent.

ActQL can do this because it separates work into three kinds: computation on values it already has, observation of data from outside, and change to the outside. It can find mechanically every point where a program talks to the outside, and it checks permissions and limits there.

This limits where a write can go. It does not make the value right. If the LLM wrongly judges a deal still in negotiation as "Closed Won", that value becomes a candidate write unchanged. The approval described next is where someone catches it before it is written.

Checks and approval in two stages

  1. The check before the run (actql check): the engine examines the program before reading any data. It checks table names, data types, the fields passed to the LLM and the permissions the program needs.
  2. The approval before the write (Checkpoint): after reading the data and getting the LLM's judgment, the run pauses just before it writes to the external system. Only at this point is it settled which records change to which values.
Run run_...
  Status      waiting_checkpoint
  Checkpoint  ckpt_...
  Effect      update  (Salesforce Opportunity)
  Items       2
  Changes
    Acme Corp - Renewal  StageName  Proposal      → Negotiation
                         NextStep   (empty)       → Send revised pricing by Friday
    Globex - Expansion   StageName  Negotiation   → Closed Lost
                         NextStep   Legal review  → Revisit next fiscal year

The approver does not have to work out from a description what the agent is about to do. They look at the data that will actually be written and decide. They approve from the CLI with actql approve, or from the SDK.

A person does not have to check every write. A rule on the count or the target can approve automatically, or a lightweight LLM can look at the change and decide whether to let it through or send it to a person. That code only returns a decision. It cannot change what is written.

The run history

The record of one execution, a Run, holds the data ActQL read, the LLM's answers, the approval decisions and the outcome of each write. Afterwards you can see what the LLM based its judgment on and how the write was handled.

Because ActQL keeps this history, it can also resume a run. If you run the program again from scratch, the external data and the LLM's answers may be different. If you resume a Run that stopped partway, it reuses the data it already fetched and the answers it already received, and sends no new requests to the external systems or the LLM for them.

$ actql approve ckpt_…
Checkpoint ckpt_…  approved
Run run_…  resuming

$ actql status run_…
Run run_…
  Status   succeeded
  Effect   update  (Salesforce Opportunity)   2 items
    Acme Corp - Renewal    applied
    Globex - Expansion     applied
  Results  updates  2 rows

ActQL has no evaluation tool of its own, but this history is the material for evals.

What the engine takes over

You can write the same thing as a script in Python or another language, but then you write the order of the fetches and the retries on error every time. When an agent writes the script, its quality also varies from one run to the next.

In ActQL you declare what to read, how to match it and what to write. The engine builds an execution plan from that and runs it. actql explain shows the plan before the run.

The plan below is for a different example, one that joins Salesforce and Snowflake.

$ actql explain churn-risk.aql

[1] READ  salesforce.accounts
    Site: connector:salesforce
    Pushdown: selected

[2] READ  snowflake.usage_30d
    Site: connector:snowflake
    Pushdown: selected

[3] JOIN  [1] + [2]
    Site: host:local (fixed)
    Engine: deferred
      Candidates: ActQL RelA, DuckDB

[4] INFER  churn-risk.v1
    Site: model provider

[5] WHERE  on risk
    Site: host:local
    Engine: deferred
    Pushdown: not eligible
      Reason: depends on INFER output

[6] EFFECT UPDATE  salesforce.Account
    Site: connector:salesforce
    Checkpoint: conditional

You do not rewrite the program when the amount of data changes. The engine hands work that the connected system can do itself, such as filtering, to that system (pushdown). It runs the rest, such as a join across Salesforce and Snowflake, itself. It chooses between its built-in engine and DuckDB for that join once it knows the row counts. Any scale on the top page has the details.

If a network error during a write leaves its outcome unknown, ActQL does not assume the write failed and send it again, because the same write could then land twice. It asks the external system for its state, and leaves as unknown whatever it cannot determine.

Comparison with current approaches

ApproachWhen it fitsWhen ActQL fits
Tool callsMCP, function callingExploratory work, where the agent decides the next operation by looking at the situation.Running reads and writes with a known procedure, with checks and approval.
Code executionShell, code modePutting together arbitrary processing as you go, in an isolated environment.Limiting what can be operated on, and checking before the run.
ApproachHow it combines with ActQL
Agent frameworksLangGraph and othersThey do not compete. Build the overall flow of the agent with the framework, and call ActQL as one of its tools.
Tracing and evaluationVendor tracing featuresThey do not compete. Follow LLM and tool calls in the trace, and check the reads and writes made to real business data in the ActQL history.

Getting started

  • To have a coding agent write programs, run npx skills add actql/skills. It teaches the agent how to write ActQL programs.
  • To build ActQL into your own application, run a program inside your process with the SDK, and wrap that call as a tool in the framework you use.

Install the preview with npm install @actql/node and npm install -g actql. actql init creates a mock project that needs no credentials, so you can try it right away.

The Quickstart walks through the whole flow, and the Node guide covers the SDK.

ActQL Program
Typed inputs · Results · Effects · Approval
        ↓
ActQL Tools
Reusable agent-callable operations
        ↓
Native tool APIs            MCP server
SDK / Agent frameworks      Local / Cloud

Coming soon.

Subscribe to the ActQL blog

Release news and blog posts from ActQL, by email.

Privacy Policy