{"slug": "a-coding-agent-can-request-a-discount-who-gets-to-approve-it", "title": "A coding agent can request a discount. Who gets to approve it?", "summary": "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.", "body_md": "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.\n\nHere 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.\n\nYou need Git, Node.js 22.16 or newer, npm, and internet access for cloning and dependency installation. Start in an empty working directory:\n\n```\ngit clone https://github.com/khaoss85/agent-crm.git framework-source\ncd framework-source\ngit checkout 3b5b5f0c4c3e582e48d54501136024b064756daa\nnode --no-warnings examples/recipes/quote-approval/run.mjs ../my-quote-crm\n```\n\nThe pinned [recipe source](https://github.com/khaoss85/agent-crm/blob/3b5b5f0c4c3e582e48d54501136024b064756daa/examples/recipes/quote-approval/run.mjs) 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.\n\nThe script contains assertions for each transition:\n\n`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.\nThe refusal also has a failed trace. That is a useful distinction: recording an unsuccessful attempt should not manufacture a successful business decision.\n\n```\ncd ../my-quote-crm\ncat data/quote-approval-receipt.json\nnpm run verify\nnpm run crm -- app inspect --json\n```\n\nIn 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.\n\nBoth 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.\n\nAccordo 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](https://accordo.dev/blog/run-a-b2b-quote-approval-workflow.html?utm_source=dev&utm_medium=syndication&utm_campaign=quote-approval).\n\nWe 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.", "url": "https://wpnews.pro/news/a-coding-agent-can-request-a-discount-who-gets-to-approve-it", "canonical_source": "https://dev.to/dpelleri/a-coding-agent-can-request-a-discount-who-gets-to-approve-it-3h07", "published_at": "2026-09-07 20:53:52+00:00", "updated_at": "2026-09-07 21:32:19.616032+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools"], "entities": ["Accordo", "Git", "Node.js"], "alternates": {"html": "https://wpnews.pro/news/a-coding-agent-can-request-a-discount-who-gets-to-approve-it", "markdown": "https://wpnews.pro/news/a-coding-agent-can-request-a-discount-who-gets-to-approve-it.md", "text": "https://wpnews.pro/news/a-coding-agent-can-request-a-discount-who-gets-to-approve-it.txt", "jsonld": "https://wpnews.pro/news/a-coding-agent-can-request-a-discount-who-gets-to-approve-it.jsonld"}}