Skip to main content
Loading navigation
Back to prompt library

Build a Delegated Voice-Commerce Action Safety Reviewer — implementation

Linked challenge: Build a Delegated Voice-Commerce Action Safety Reviewer

Prompt source

implementation68 lines11 sectionsNo variables1 code block
## Build
Analyze voice assistant transaction execution traces against registered user consent policies. Detect prompt injection, unintended purchases, and voice authorization mismatches.

## User
E-Commerce Consumer Safety Officer

## Workflow
1. Capture raw intent parse outputs from vernacular voice ordering sessions.
2. Reconcile requested cart actions against the user's active delegation and consent envelope.
3. Evaluate transcript for potential acoustic ambiguity or coerced command indicators.
4. Produce risk-scored transaction confirmation tickets requiring secondary tactile approval.

## Interface
Safety operations queue showing flagged voice transactions, audio confidence scores, and consent scopes.

## Data
Generate synthetic voice order intent logs with varying levels of ambiguity and delegation scopes.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Bhashini documentation](https://bhashini.gitbook.io/bhashini-apis)
Utilizes Bhashini ASR pipeline intent representations to assess vernacular speech transaction safety.

## Tools
dspy, pydantic, fastapi.
Optimizes verification prompts to assess command confidence and detect ambiguous speech intent.
Local or hosted LLM with strong few-shot logical inference capabilities.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Identifies ambiguous voice commands where product variant or quantity is doubtful.
- Cross-checks action parameters against delegated user permission boundaries.
- Triggers step-up confirmation whenever confidence falls below established thresholds.
- Emits structured safety audit receipts for each processed voice interaction.

## Starter Examples
```json
[
  {
    "input": {
      "session_id": "VCE-901",
      "asr_confidence": 0.94,
      "parsed_intent": "order_item",
      "item_name": "Basmati Rice 5kg",
      "consent_limit_inr": 1000,
      "order_value_inr": 650
    },
    "expected_output": {
      "action": "AUTO_APPROVE",
      "risk_score": 0.05,
      "requires_secondary_confirmation": false,
      "reason": "Clear intent, high confidence, within consent spend limits"
    }
  },
  {
    "input": {
      "session_id": "VCE-902",
      "asr_confidence": 0.61,
      "parsed_intent": "order_item",
      "item_name": "Gold Coin 10g",
      "consent_limit_inr": 500,
      "order_value_inr": 65000
    },
    "expected_output": {
      "action": "HOLD_FOR_CONFIRMATION",
      "risk_score": 0.95,
      "requires_secondary_confirmation": true,
      "reason": "Low acoustic confidence and transaction exceeds consent limit by more than 100x"
    }
  }
]
```

## Safety
Evaluates mock purchasing prompts; all financial transactions are simulated and non-binding.
Use mock external writes. Require human review before any real deployment.