Skip to content

Feature | Async friendly Always Encrypted support #3672

Description

@cheenamalhotra

Always Encrypted types today don't support async APIs in base class as well as in implementations, leading to sync-over-async in Async workflows. This gap is important to fill for a true async workflow experience when executing commands where encryption/decryption is needed to be performed.

This will be covered in following tasks:

Implementation PRs

Key-store integration split

The changes in #4585 are being split into five draft PRs for targeted review. Each PR targets the preceding layer; the first targets main. Tests stay with the behavior they protect.

Layer Scope PR
1 Async symmetric-key cache: same-key deduplication, independent-key concurrency, sync-provider compatibility, cancellation, and cache publication #5077 (draft)
2 Async cryptographic utilities: CEK decryption, provider dispatch, candidate-key fallback, and CMK signature verification #5079 (draft)
3 Parameter discovery: shared describe parsing, deferred key operations, Reader/NonQuery/XML cancellation and cleanup #5080 (draft)
4 Query-metadata cache: async key loading, cancellation without eviction, and stale-cache fallback #5081 (draft)
5 Enclave-package key loading: async package generation, connection revalidation, and bounded retries #5085 (draft)

Earlier layers are foundations, not individually the complete end-to-end feature. The cumulative split will be checked against #4585 before it is treated as the replacement. Existing async attestation work is already on main and is not being reintroduced.

Remaining integration gaps

  • Complete and review the five-layer key-store integration split above.
  • Wire async key decryption into SqlBulkCopy async execution (CopyBatchesAsync -> TdsParser.LoadColumnEncryptionKeys currently calls synchronous DecryptSymmetricKey). This pre-existing path is outside the split and remains follow-up work.
  • Run enclave-specific retry/reuse integration coverage with enclave-enabled server configuration; these cases were skipped in Use the async Always Encrypted key store APIs on async execution paths #4585 build 184898.

End-to-end enclave-server validation and overall test coverage remain incomplete.

Activity

  1. added this to the 7.0.0 milestone on Oct 8, 2025
  2. moved this from To triage to Backlog in SqlClient Boardon Oct 16, 2025
  3. moved this from Backlog to In progress in SqlClient Boardon Oct 16, 2025
  4. modified the milestones: 7.0.0-preview4, on Jan 20, 2026
  5. removed this from the milestone on Feb 12, 2026
  6. 13 remaining items

  7. moved this from Backlog to In progress in SqlClient Boardon Aug 14, 2026
  8. priyankatiwari08 commented on Sep 17, 2026

    @priyankatiwari08
    Contributor

    /triage

  9. github-actions commented on Sep 17, 2026

    @github-actions

    🔍 Triage Summary (on-demand re-triage)

    Check Result
    Issue type Feature (tracking/epic issue with sub-tasks)
    Environment Not applicable — this is a feature/design tracking issue, not a bug report
    Area Area\AKV Provider (Always Encrypted enclave providers and encryption/decryption async path)
    Duplicates None found — related but distinct: #4480 (enclave provider refactor), #4425 (AE modernisation/optimisation)
    Regression Not applicable

    Analysis

    This is a milestone-tracked (8.0.0) feature/epic issue to eliminate sync-over-async behavior in Always Encrypted (AE) workflows by adding true async counterparts across the base classes, key store providers, and enclave provider implementations (NoneAttestationEnclaveProvider, AzureAttestationEnclaveProvider, VirtualizationBasedSecurityEnclaveProviderBase). Two of the linked sub-tasks (#3673, #4540, #4541) are already merged/closed, and the remaining work is enclave provider async implementations, wiring async APIs into async code paths, and adding test coverage. This is a design-sensitive, internally-maintained effort (per @mdaigle's comment) — not yet open to external contribution. Severity: P2 (planned engineering improvement, not a defect).

    Next Steps

    • No environment validation needed since this is a feature/epic, not a bug.
    • Recommend keeping this issue as internally driven per @mdaigle's earlier comment; external contribution (e.g. from @RutulPatel8) should wait until the internal design discussion for enclave provider async support concludes, to avoid conflicting approaches to Task.FromResult-based fallbacks vs. true async implementations.
    • Suggest cross-linking Refactor enclave providers to separate enclave-type from attestation-mechanism (composition over inheritance) #4480 (enclave provider refactor) since both issues touch NoneAttestationEnclaveProvider/AzureAttestationEnclaveProvider/VirtualizationBasedSecurityEnclaveProviderBase — sequencing these two efforts (refactor vs. async support) could reduce merge conflicts and duplicated work.
    • Continue tracking remaining checklist items (enclave provider async implementations, async code path wiring, testing/coverage) as sub-issues or PRs linked to this tracking issue.

    Note: This triage summary is auto-generated by an AI agent. The analysis and suggestions above have not been verified by a human maintainer. Please treat as preliminary guidance only.

    Generated by SqlClient Issue Auto-Triage for #3672 · copilot · auto · 43.4 AIC · ⌖ 13.1 AIC · ⊞ 11.9K · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ApprovedUse for Features approved for implementation.

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions