Translation API security: protect keys and customer data
Build a safer translation pipeline with scoped keys, PII redaction, retention controls and auditable access.

Keep API keys out of the client
Never put a TranslateHub key in browser code, a Git repository or an application log. Call the API from your server, inject credentials through environment variables or a secrets manager, and create separate keys for development, staging and production.
Use least privilege and rotation
Create one key per service and restrict its endpoints, origins and quota. A compromised key can then be revoked without taking down the whole platform. During rotation, keep a short overlap window: deploy the new key first, verify traffic, then remove the old key.
Redact personal data before translation
Names, emails, phone numbers, addresses and order IDs may be personal data. Replace sensitive fields with stable opaque placeholders before sending text, then restore them inside your trusted application. Validate that placeholders survive the response unchanged.
source: "Hello, {{CUSTOMER_NAME}}"
translated: "你好,{{CUSTOMER_NAME}}"Set retention and audit rules
Retain only the request data needed for support. Redact payloads in normal logs and delete full source and target text on a defined schedule. Record request_id, calling service, key identifier, status and latency, never the Authorization header. Restrict audit-log access and review unusual usage regularly.
Pre-launch checklist
- Keys are server-side only and stored in a secrets manager.
- Each environment uses different credentials.
- PII is redacted before sending and placeholders are checked afterward.
- Logs contain no Authorization headers or unredacted payloads.
- Rotation, revocation and unusual-usage runbooks are documented.