Feature × Audience

How do developers implement BYOK with Plugsky?

Developers implement BYOK by wiring a customer-managed master key from KMS or HSM into the platform, then relying on envelope encryption: data keys protect prompts, completions, embeddings and logs, and your master key wraps them. The work is mostly operational — key policies, rotation, revocation testing and environment separation — not a new API surface. Plugsky supports AWS KMS, Azure Key Vault, HashiCorp Vault and on-prem HSM.

Key facts

Key storesAWS KMS, Azure Key Vault, HashiCorp Vault or on-prem HSM
Encryption modelAES-256 at rest with envelope encryption; TLS 1.3 in transit
API impactApplication calls stay OpenAI-compatible; key management is configuration
RevocationDisabling the master key stops access to protected data
RotationScheduled master key rotation with data key re-wrapping
EnvironmentsSeparate keys per environment and workspace
AuditKey operations and data access exportable to SIEM
StatusCustomer-managed keys are live on enterprise plans; confirm specifics with the enterprise team

TL;DR

  • BYOK is configuration plus operations, not a new API to code against.
  • Use envelope encryption so rotation touches data keys, not your master key.
  • Test revocation and rotation in staging; untested controls fail when needed.
  • Separate keys per environment so staging can never read production data.
  • Stream key operations to your SIEM and alert on anomalies.

How it works, step by step

  1. Create a master key in your KMS or HSM with a policy that limits which roles and services may use it.
  2. Connect it to your Plugsky enterprise workspace, confirming which data classes it protects.
  3. Keep separate keys per environment; staging keys must not be able to decrypt production data.
  4. Implement rotation as a scheduled job that re-wraps data keys, and log every operation.
  5. Test revocation in staging: disable the key, observe what stops, re-enable and document the blast radius.
  6. Route key usage and access events into your observability stack, with alerts on unusual decrypt patterns.
  7. Document escrow and break-glass procedures, and make key recovery part of your incident runbooks.
1Create a master keyin your KMS or HSMwith a policy that2Connect it to yourPlugsky enterpriseworkspace,3Keep separate keysper environment;staging keys must4Implement rotationas a scheduled jobthat re-wraps data5Test revocation instaging: disablethe key, observe6Route key usage andaccess events intoyour observability

Try it yourself

Open the AI API key security checklist →

What you actually build

BYOK does not change your application code. Chat completions, streaming and embeddings remain OpenAI-compatible; the key is a configuration and operations concern around the platform. What you build is the key policy, the rotation job, the alerting and the runbooks.

The mechanism is envelope encryption. Your master key stays in KMS or HSM and wraps the data keys that protect stored objects. That indirection is why rotation is cheap and revocation is decisive: you change the wrapper, not every object, and you disable access without deleting data.

Environment separation and testing

Most BYOK incidents are self-inflicted: staging keys reused in production, rotation jobs that fail silently, or revocation paths nobody has exercised. Separate keys per environment and per workspace, and make the separation testable — a staging credential should demonstrably fail against production data.

  • Rotation: schedule it, monitor duration and completeness, and verify samples decrypt afterwards.
  • Revocation: rehearse it; know which workloads stop and how recovery works.
  • Alerts: unusual decrypt volume or geography is an early signal of misuse.

The operational trade-offs

BYOK trades convenience for control. With provider-managed encryption, key availability is the provider's problem; with customer-managed keys, it is yours. That means KMS redundancy, documented escrow and a recovery plan that has been executed at least once outside production.

Be honest about scope in your own documentation: BYOK protects stored data, while inference happens in memory. Pair it with region pinning, access controls and audit export to cover the rest, and only adopt BYOK where a real requirement — regulation, customer contract or risk policy — justifies the operational load.

Honest comparison

Developer concernBYOK on PlugskyProvider-managed encryptionSelf-built serving
Code changesNone; configuration and operationsNoneFull encryption design
Key custodyYour KMS or HSMProviderYour estate
RotationYour schedule and toolingProvider-scheduledYour implementation
RevocationImmediate through key policyNot available to youFully yours
Failure modeYour key store becomes a dependencyProvider outage onlyAll on you
Adopt whenCompliance or contract requires itDefault for most teamsYou operate the platform

Frequently asked questions

Does BYOK change the API I call?

No. Chat completions, streaming and embeddings stay the same. BYOK adds a customer-managed key on enterprise plans and surrounding operational work.

Which key stores can I use?

AWS KMS, Azure Key Vault, HashiCorp Vault and on-prem HSM are documented options, alongside per-region platform encryption for those who do not need customer-managed keys.

How does rotation avoid rewriting data?

Envelope encryption. Data keys encrypt objects, and your master key wraps those data keys, so rotation re-wraps keys rather than re-encrypting all data.

What breaks if I revoke a key?

Anything protected by it becomes unreadable. That is the point of a kill switch, but it means revocation must be tested in staging and covered by incident runbooks.

Should staging and production share a key?

No. Separate keys per environment and workspace, and verify that staging credentials cannot decrypt production data. Shared keys are a common and serious mistake.

What should I monitor?

Key usage patterns, decrypt failures, rotation job outcomes and access changes. Alert on unusual volume or unexpected principals, and route events to your SIEM.

When is BYOK worth the operational cost?

When a regulation, customer contract or internal risk policy requires it. For most teams, region pinning, access controls and audit export cover the need without the extra dependency.