Skip to main content
Loading navigation
Back to prompt library

Build a Cross-Border Customs Valuation Exception and Consignee Clarification Assistant — implementation

Linked challenge: Build a Cross-Border Customs Valuation Exception and Consignee Clarification Assistant

Prompt source

implementation78 lines11 sectionsNo variables1 code block
## Build
Detect declared customs valuation discrepancies between cross-border commercial invoices and freight rate baselines. Generate structured TradeTrust evidentiary packages and draft formal consignee clarification queries.

## User
Customs Compliance Broker

## Workflow
1. Extract declared CIF prices, incoterms, and currency conversion rates from normalized trade permits.
2. Compare declared values against historical benchmark price bands for identical HS codes.
3. Bundle anomalous valuation records into an OpenAttestation wrapped compliance dossier.
4. Draft a structured clarification notice to the consignee requesting proof of payment and contracts.

## Interface
A compliance analyst audit workbench showing price deviation percentiles, HS code benchmark comparisons, and notice generation tools.

## Data
Use open-attestation npm tools with synthetic customs declaration files containing deliberate valuation anomalies.
Starter examples below are synthetic. They are not downloaded records.

## Source
[OpenAttestation](https://raw.githubusercontent.com/Open-Attestation/open-attestation/master/README.md)
Apply OpenAttestation wrapDocuments and obfuscateDocument to protect sensitive counterparty pricing while preserving proofs.

## Tools
anthropic-claude, @govtechsg/open-attestation, pydantic.
Anthropic Claude delivers high-precision document comparison and clear regulatory correspondence drafting.
Hosted Claude API with system prompt enforcement for objective document analysis.

## 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
- Detects CIF declared values deviating more than 35% from historical HS code medians.
- Generates an OpenAttestation wrapped evidence record with cryptographic salt fields.
- Supports selective obfuscation of trade counterparty names before sharing audit files.
- Produces compliant consignee clarification letters requesting purchase contracts and wire receipts.

## Starter Examples
```json
[
  {
    "input": {
      "declaration_id": "DEC-SG-2025-401",
      "hs_code": "8471.30.10",
      "cargo_description": "Laptops and portable processors",
      "declared_cif_sgd": 120,
      "historical_median_cif_sgd": 850,
      "deviation_percent": -85.8,
      "consignee_entity": "Apex Electronics SG Pte Ltd"
    },
    "expected_output": {
      "risk_tier": "high_undervaluation_suspect",
      "oa_wrapped": true,
      "obfuscated_preview_available": true,
      "clarification_request": {
        "recipient": "Apex Electronics SG Pte Ltd",
        "subject": "Inquiry: Declared Value Discrepancy for HS 8471.30.10",
        "mandatory_documents": [
          "Original commercial sales contract",
          "Proof of overseas wire remittance",
          "Manufacturer price confirmation"
        ]
      }
    }
  },
  {
    "input": {
      "declaration_id": "DEC-SG-2025-402",
      "hs_code": "8471.30.10",
      "cargo_description": "Enterprise micro-servers",
      "declared_cif_sgd": 920,
      "historical_median_cif_sgd": 850,
      "deviation_percent": 8.2,
      "consignee_entity": "CloudTech Solutions Pte Ltd"
    },
    "expected_output": {
      "risk_tier": "nominal",
      "oa_wrapped": false,
      "obfuscated_preview_available": false,
      "clarification_request": null
    }
  }
]
```

## Safety
Prepares compliance clarification drafts; does not submit binding customs reassessments or impose administrative penalties.
Use mock external writes. Require human review before any real deployment.