Registry Mirror
Skip to content

feat(observability): describe credential preparation outcomes #5395

Open
afourniernv/OpenShell
#10

Description

@afourniernv

User Story

I run OpenShell workloads that call protected APIs. I need to distinguish credential preparation failures from policy and upstream failures without exposing credentials.

Problem Statement

The existing credential stage does not identify the preparation mechanism, placement or bounded result. A configured provider or an upstream status code does not establish what OpenShell prepared for a particular request.

Impact / Why This Matters

Operators can mistake credential resolution/signing failures for policy denials or assume a credential was used merely because a provider was configured.

Proposed Design

Enrich the existing credential-preparation spans with bounded mechanism, placement and preparation outcomes for static header/body substitution, Basic authentication, SigV4 and token grants. Distinguish prepared, not-needed, refused, failed and stale preparation at the actual preparation sites.

Preparation does not prove transmission or upstream receipt. A request stopped before preparation has no preparation stage; that is not a new "withheld" event. Preserve credential custody, endpoint/placement restrictions, policy ordering and existing OCSF records. Do not add tokens, claims, exchange bodies or a new audit summary.

Suggested UX

Expand a request's credential stage to see how preparation finished, then inspect later stages separately to determine whether forwarding occurred. Join existing security records using the request ID.

Acceptance Criteria

  • Mechanism, placement and bounded preparation outcomes describe work that actually ran.
  • Unused resolvers and removed headers do not imply credential preparation or delivery.
  • Preparation refusals, operational failures and staleness remain distinguishable without exposing secrets.
  • Existing enforcement, credential delivery behavior, public contracts and audit emissions remain unchanged.

Alternatives Considered

Provider configuration alone does not show per-request preparation. Upstream status codes cannot prove which credential OpenShell supplied. Additional security-log summaries would duplicate existing per-control records.

Agent Investigation

The current HTTP correlation core already supplies the credential-stage boundary. This change adds span metadata at static and token-grant preparation sites without adding a provider API, configuration knob or OCSF field.

Component of #5210. It does not depend on remote middleware RPC tracing.

Checklist

  • I've reviewed existing issues and the published docs.
  • This is a design proposal, not a "please build this" request.

Activity

  1. added
    state:triage-needed
    on Nov 9, 2026
  2. changed the title [-]feat(observability): correlate credential preparation and withholding[/-] [+]feat(observability): describe credential preparation outcomes[/+] on Nov 17, 2026
  3. afourniernv commented on Nov 30, 2026

    @afourniernv
    ContributorAuthor

    @krishicks any thoughts on whether we can land this or not?

  4. added
    state:accepted
    and removed
    state:triage-needed
    on Dec 1, 2026
  5. krishicks commented on Dec 2, 2026

    @krishicks
    Contributor

    Drafted by 🤖, signed off by @krishicks

    @afourniernv thanks for the draft in afourniernv#10. I'm going to take #5395 myself, because I want to change the approach rather than layer attributes onto each call site:

    • A typed preparation outcome, with the error types defining how failures are classified.
    • One stage helper, so every credential site records its outcome the same way.
    • prepared derived from what the rewriter reports it substituted, not from comparing bytes.
    • The response code, span and OCSF record all derived from one classification.

    This also closes a gap: forward-proxy credential failures currently emit no OCSF record. I'll reuse your test cases where they fit and tag you for review.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:accepted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions