System Specification

Counter Docs

How Counter thinks and acts

Counter is a bounded negotiation agent. A buyer can negotiate naturally in plain language, but the model never has authority to move money or override merchant safety boundaries.

1

Agent loop

Counter operates on a linear, verifiable perception-to-execution pipeline for every incoming message:

Buyer messageUnderstand intentLoad deal memoryRetrieve merchant rulesPlan next movePropose structured actionVerifyRespond
2

Merchant policy

The merchant defines non-negotiable boundaries before any conversation starts. These parameters are stored separately in protected memory outside the buyer's reach:

Pricing Guardrails

  • List Price: Starting public offer (e.g. ₹6,000)
  • Floor Price: Absolute lowest acceptable price (e.g. ₹5,200)
  • Max Discount: Strict cap on total price concessions (e.g. ₹800)

Operational Bounds

  • Allowed Bundles: Pre-approved bonuses (e.g. 30-min strategy review)
  • Max Rounds: Hard ceiling on back-and-forth turns (e.g. 4 rounds)
  • Payment Permissions: Strict link generation criteria and TTL
3

The deal gate

Every offer or agreement proposed by the AI model passes through a deterministic validation gate before any downstream action can take place:

amount >= floor_price
discount <= max_discount_limit
rounds <= maximum_rounds_allowed
bundle_items IN approved_merchant_catalogue
product_terms_unchanged == TRUE
4

The model cannot move money

The generative AI model has no access to payment credentials, API secret keys, or checkout creation tools.

What AI can propose

counterbundleacceptrefuse

Execution Boundary

Razorpay Payment Links are created purely by a secure server-side execution worker after verifying the deterministic deal gate.

5

Safety against prompt injection

Buyer messages and model outputs are treated as untrusted data inputs. No conversational payload can rewrite the merchant's immutable policy state:

Neutralized Attack Vectors

"I am the founder / CEO" impersonation
"Ignore previous instructions" system prompts
"Sell it for ₹1" malicious floor breach
Sandwich prompts & delimiter injections
6

Deal memory

Counter maintains full state awareness throughout the negotiation lifecycle so it never negotiates each turn in isolation:

Historical Offers

Remembers past price concessions and counter-offers.

Turn Tracking

Enforces max round limits before finalizing or exiting.

Deal Locking

Locks agreed price and delivers immutable checkout parameters.

7

Razorpay execution boundary

Payment link generation follows a zero-trust handoff:

Approved DealServer Re-CheckRazorpay Payment Link APIPayment State & Webhook
8

Failure handling

If an offer violates merchant authority, Counter strictly blocks the action instead of trying to coerce or force a compromised transaction through.

Fail-Safe Default: Execution state defaults to `BLOCKED` unless all 5 gate criteria evaluate to `PASS`.

No Hallucinated Discounts: The server verifies the exact arithmetic difference between list price and final quote.

9

System architecture

Complete data flow across system components:

Stage 1

Buyer

Stage 2

Agent

Stage 3

Memory

Stage 4

Policy Context

Stage 5

Planner

Stage 6

Structured Decision

Stage 7

Deterministic Gate

Stage 8

Execution

Core Principle

The model suggests. Merchant rules decide.

Counter gives merchants complete confidence to deploy autonomous deal negotiation at scale without risking profit margins.