Safi.pkFOR AGENTSکوٹیشن کی درخواست ↗

ڈویلپر رہنمائی: درست تکنیکی مثالیں انگریزی میں دی گئی ہیں۔ قیمت، اہلیت اور فراہمی کی تصدیق ضروری ہے۔

SAFI / DEVELOPER HUB / v1.1

Operate without losing trust.

Run one service instance on durable local storage. Keep discovery public and commercial data principal-owned.

Health, storage and deployment

GET /health/live checks the process. GET /health/ready checks SQLite access. One instance, one persistent local disk; no ephemeral replicas or network filesystem for SQLite WAL. The existing Node 24 Docker recipe installs the isolated SDK lockfile and retains tsx at runtime. A PostgreSQL adapter is required before multi-host scaling.

Back up with SQLite's online backup API or stop the service and copy a consistent database/WAL/SHM set. Test restoration before relying on backups. Disk space, permissions and backup freshness need host monitoring. Quotes/tasks are bounded and retained; agree a retention/deletion policy before production and preserve idempotency evidence during cleanup.

Issue, rotate and revoke keys

Generate 32+ random bytes, give the raw token privately to one client and store only its SHA-256 digest with a stable principal/role in AGENT_API_KEYS. Restart to load changes. Rotation under the same principal retains quote/task ownership; remove old digests to revoke. Never publish credentials or put them in URLs. Reviewer keys read review/metrics endpoints; they cannot invoke agent mutations or approve a quote.

Redacted measurements

GET /api/v1/metrics requires a reviewer key. It exposes aggregate discovery, protocol outcomes/errors, HTTP status/latency, quote creation/review and handoff counters. The a2a_catalog_to_quote_context measure counts the first quote after successful structured discovery/recommendation in the same authenticated, unexpired context. It excludes anonymous catalog views, does not prove a person read the catalog, and never counts revenue. Simulated traffic is server-labeled. Authenticated means an issued key holder, not a verified AI platform. User-Agent labels are not proof of ChatGPT, Claude, Gemini or any other identity. No request bodies, domains, principals or credentials are metric labels.

Production configuration

NODE_ENV=production
AGENT_PUBLIC_ORIGIN=https://ai.safi.pk
AGENT_HOST=0.0.0.0
AGENT_PORT=3210
AGENT_DB_PATH=/var/lib/safi-agent/quotes.sqlite
AGENT_API_KEYS=[operator-managed principal/digest/role entries]
AGENT_TRUST_PROXY=false

Terminate TLS at a trusted ingress, keep port 3210 private, preserve no-store on private responses and replace forwarded headers before enabling proxy trust. Optional AGENT_DOMAIN_SEARCH_ORIGIN uses only the existing allowlisted read-only search; demo mode disables provider calls. Missing model keys do not affect this service because no model is used.

DNS and hosting setup are later owner actions. Billing readiness, premium domain confirmation, provider credentials, exact quote binding, support/review ownership and renewal/provisioning terms remain separate dependencies. No deployment or live order is authorized by a successful protocol test.

Verified snapshots and operational retries

The operator-only storage-cli.ts uses SQLite online backup with integrity/schema checks, SHA-256 output and an exclusive new destination. Restore requires the recorded digest. Node 22.16+ and a protected local-disk directory are required; backups contain private records. The tool never replaces an existing database. See agent-commerce/docs/OPERATIONS.md in the repository for commands and the isolated recovery procedure.

Rate-limit HTTP 429 includes Retry-After; resource_limit HTTP 429 has no timed reset and requires operator action. Controlled engine unavailable errors return HTTP 503. Retry the identical messageId and configuration after recovery; unexpected failures remain redacted JSON-RPC -32603. No retry authorizes a price change or provisioning.