← Back to the journal

DataFocus · Journal

How to require human approval before an AI agent writes to a business system

A design pattern for agent writes: draft, diff, validation, approval bound to one immutable plan, commit and read-back, illustrated with the plan and execute tools in DataFocus OT Flash's documented Business Workspace MCP.

Split every agent write into two tools: one that only creates an immutable plan, and one that executes a plan after a person has approved that exact plan. The approval must be tied to the plan's contents and to the version of the record it changes, and the token that proves approval must come from the system of record, not from the agent. If the plan or the target version changes, the approval is void and a person has to look again. The rest of this post shows that pattern step by step, using the plan and execute tools in DataFocus OT Flash's Agent and MCP manual as the worked example.

Why must approval bind to a specific plan, not a session?

A common first design is a chat prompt: "The agent wants to update this order. Allow?" The person clicks yes, and the session is now trusted. That approves an intent, not an action. Between the click and the write, the agent can rewrite its arguments, the record can change under it, or a retry can fire the write twice.

OWASP's LLM06:2025 Excessive Agency (2025) defines the risk as damaging actions performed in response to unexpected, ambiguous or manipulated model output, and lists, among its mitigations, requiring a human to approve high-impact actions before they are taken. The EU AI Act's Article 14 (Regulation 2024/1689, text as published by the Future of Life Institute) asks that high-risk systems can be effectively overseen by natural persons, including being able to disregard, override or reverse the output. Neither text tells you how to build the gate. That is the engineering question here.

The binding rule that follows: the thing a person approves must be a frozen object, so what runs is exactly what was reviewed. DataFocus describes the same rule for its own changes: approval applies to a specific plan and base version, and must be confirmed again when either changes.

What are the six steps from draft to read-back?

DataFocus's permissions documentation lists the lifecycle for changes as draft, diff, validation, approval, commit and read-back. Here is what each step has to guarantee in your own agent system.

StepWhat it must guaranteeWhat breaks without it
1. DraftThe agent can only propose; it holds no write credential for the targetThe agent writes directly
2. DiffThe reviewer sees before and after, not a prose summaryThe person approves a description, not a change
3. ValidationSchema, permission and business-rule checks run before a human is askedPeople spend time on plans that cannot apply
4. ApprovalA token tied to this plan hash and this base versionApproval of "something like this"
5. CommitExecution re-checks versions, hashes, expiry and approvalStale or altered plans run
6. Read-backA fresh read of the target proves the state changed"Done" is taken from the model's own words

DataFocus's product brief states the first constraint plainly: when AI wants to change something it can only submit a draft, which takes effect after a person approves it. DataFocus's MCP description adds that agents can submit drafts for control panels and other changes that are applied after human approval.

How do plan and execute work as separate tools?

OT Flash's r56 Agent and MCP manual documents a Business Workspace at /mcp/business, a protected resource separate from the ontology endpoint /mcp. The ontology grant cannot be reused for business authorization. The business scopes are split by what they permit:

  • business-system:discover covers dfb_systems and dfb_system_describe.
  • business-system:read covers dfb_query, dfb_record, dfb_work_items and dfb_action_status.
  • business-system:plan covers dfb_action_plan, which creates immutable plans without executing anything.
  • business-system:execute covers dfb_action_execute and is a separate, explicit authorization.

The split matters because a grant that can plan cannot execute unless someone granted the execute scope too. You can give an agent read and plan scopes first and decide later whether it should ever hold execute.

The manual says dfb_action_plan takes a releaseId, releaseHash, canonicalIrHash, agentManifestHash, a commandType, a planIdempotencyKey and the contract payload. The caller must then check riskClass, requiresApproval and status, and keep the expectedRecordVersion for the target records. Those hashes pin the plan to a published definition of the business action, so the agent cannot swap in a different action after review.

A schematic of the call order follows. It is illustrative, not run, and the field values are placeholders; read your instance's real tools/list for the actual schemas, because the manual says the available tools depend on the instance, the product version and the account's permissions.

# illustrative, not run
1. dfb_system_describe        -> read published contract, releaseId, hashes
2. dfb_record                 -> read target; keep expectedRecordVersion
3. dfb_action_plan(...)       -> plan created, NOT executed
                                 check: riskClass, requiresApproval, status
4. (human reviews diff, approves in the DataFocus UI)
5. dfb_action_execute(planId) -> server re-checks, then executes
6. dfb_action_status(planId)  -> confirm outcome
7. dfb_record                 -> read back the target

Who issues the approval token, and why can't the agent?

In the manual, dfb_action_execute runs only plans that belong to the current connection and are ready, and approval tokens that humans must provide are issued by DataFocus. For artifact changes, the manual states that approvalToken is server-issued material that an agent cannot replace by writing a string. It also says that agent-provided instructions and declarations are agent inputs, not human policy signatures, and that the original mechanisms still decide authoring, publishing, delegation and business confirmation.

For your own system, this translates into three rules:

  1. The approval token is minted by the approval service after an authenticated person acts, never by code the agent controls.
  2. The token is verified at execute time against the plan hash it was issued for.
  3. A text reply such as "approved" in the agent's context is never an approval.

At execution time, DataFocus's manual says the published version, IR and manifest hashes, target record versions, plan expiration, idempotency and approvals are all re-checked, and that the OAuth allowlist cannot bypass business governance. Re-checking at commit, not only at plan time, is what closes the gap between "approved" and "applied".

One more boundary: the manual says the plan and its approval stay with the connection that created them. Another OAuth connection cannot take over a plan, and identifiers such as planId or approval tokens from another connection must not be merged into the current one. That limits what a compromised or confused second agent can replay.

How do you handle retries and replays safely?

Timeouts are where approval gates usually leak. If the execute call times out and the agent retries with a new key, you can apply one approved change twice or, worse, apply a different one.

The documented behavior is conservative:

  • A plan carries an idempotency key, and retries preserve the original idempotency semantics. After a failure or timeout, dfb_action_status recovers the original plan.
  • For writes with an unclear outcome, the manual describes a MCP_OPERATION_OUTCOME_UNKNOWN result with retryable=false and a next action to read the original status. The caller should not resubmit candidates, change idempotency keys, or treat a timeout as a rollback.
  • The caller should preserve verbatim the grant, resource scopes, task and result IDs, the hashes, expected revisions and target versions, and the idempotency key for the same logical operation, using new keys only for different operations.
  • For artifact changes, after the target changes the old plan can no longer be applied and the context must be re-read. The manual also stresses that a ready plan is not an applied one: only an APPLIED receipt represents actual application.

That last point generalizes. The manual's completion rules say answer text, HTTP 200, or a model saying "done" cannot alone prove success; it asks for server receipts. In your own agent, make the final step a read-back of the changed record and compare it with the approved diff.

How do you test the flow without touching production?

DataFocus's getting-started guidance is to define the task, its business owner, acceptance criteria and permitted scope, and to start with synthetic data. Its public interactive demos use simulated data and do not change production systems. In one published demo scenario (the coding-agent demo on DataFocus's homepage, with synthetic data), the agent proposes a draft, stops and asks when a definition is unclear, reports that it wrote nothing to the source, and cannot approve its own change; publishing needs someone with authority. That is the behavior to copy into your test plan.

A checklist for your own test suite, all on synthetic records:

  1. Plan, then change the target record, then try to execute. Expect refusal.
  2. Plan, approve, then change the plan payload. Expect refusal.
  3. Execute with a token the agent made up. Expect refusal.
  4. Execute, drop the response, retry with the same key. Expect one applied change.
  5. Retry with a new key after a timeout. Expect your system to reject it or to flag it, not to apply twice.
  6. Let a plan expire, then execute. Expect refusal.
  7. Replay a plan from a second connection. Expect refusal.

When this pattern is not the right fit

  • Approval on every action trains reviewers to click through. Gate by risk class and keep read-only calls free of approval. OWASP's wording is high-impact actions, not all actions.
  • The pattern assumes the system of record can hold plans, hashes and versions. If you are wrapping a legacy API that cannot, you have to build that layer yourself.
  • The documented tools are specific to OT Flash r56 and to an instance with the Business Workspace enabled. DataFocus states there is no public MCP endpoint or live sandbox, so you cannot try these tools without your own authenticated instance. OT Flash is available from the download page and the GitHub repository, with system requirements in its release notes.

Next step

Read the OT Flash Agent and MCP Integration Manual (r56) for the Business Workspace section, and DataFocus's permissions documentation for the control list on writes.