cd /news/ai-agents/a-coding-agent-can-request-a-discoun… · home topics ai-agents article
[ARTICLE · art-122719] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

A coding agent can request a discount. Who gets to approve it?

Accordo, an open-source framework for building custom CRMs with coding agents, demonstrates a quote-approval workflow where an agent can request a discount but requires human approval above a threshold. The example shows a synthetic customer requesting 25% off 30 Enterprise seats, with automatic approval up to 10% and user decision required above that. The framework records both refusals and approvals in an audit trail, distinguishing failed attempts from successful business decisions.

read2 min views1 publishedSep 7, 2026

An approval rule becomes useful when you can test what happens on both sides of it: the forbidden action is refused, and the permitted decision leaves evidence. A happy-path demo alone cannot show that distinction.

Here is a runnable example using Accordo, the open-source framework coding agents use to build custom CRMs. A synthetic customer wants 30 seats of an Enterprise Plan and requests 25% off. The existing policy permits automatic approval through 10%; above that, through 50%, it requires a user decision.

You need Git, Node.js 22.16 or newer, npm, and internet access for cloning and dependency installation. Start in an empty working directory:

git clone https://github.com/khaoss85/agent-crm.git framework-source
cd framework-source
git checkout 3b5b5f0c4c3e582e48d54501136024b064756daa
node --no-warnings examples/recipes/quote-approval/run.mjs ../my-quote-crm

The pinned recipe source creates a project, installs its dependencies and composes the existing commercial package. It then starts a temporary server on localhost and drives the public SDK through HTTP. The catalog is a fixture; the business journey does not call an external provider. It uses source from the checkout, independently of the npm scaffolder release.

The script contains assertions for each transition:

pending_approval. HUMAN_APPROVAL_REQUIRED. The quote and approval remain pending, and no business audit entry is added.approved, with one user decision audit and a completed trace. The refusal also has a failed trace. That is a useful distinction: recording an unsuccessful attempt should not manufacture a successful business decision.

cd ../my-quote-crm
cat data/quote-approval-receipt.json
npm run verify
npm run crm -- app inspect --json

In the receipt, inspect agentRefusal, refusalTrace, decision, humanAudit and approvalTrace. The quote, version and approval identifiers connect those records. sourceCommit and recipeSha256 identify the implementation used. The local database remains in data/accordo.sqlite; another replay needs a new target directory.

Both identities are scripted and asserted locally. No person authenticates or clicks Approve during this replay. Production needs verified identity and explicit authorization configuration; the sales-manager approval key is a label, not an authenticated role. This is not an agent-build benchmark or a production deployment.

Accordo vendors source into the project you own. You can review and adapt the rules while keeping the refusal checks. The full walkthrough includes the client brief and recorded execution.

We are looking for three teams with a real quoting or approval process to try a bounded pilot. If that sounds relevant, leave a comment with the process and the rule that must hold. Please use a synthetic example and omit customer records or other confidential information. We will agree the scope and success criteria before starting.

── more in #ai-agents 4 stories · sorted by recency
── more on @accordo 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/a-coding-agent-can-r…] indexed:0 read:2min 2026-09-07 ·