Skip to content

Proposal: preserve source classification across derived data flows #131

Open

Description

@Prakash-codeMaker

Summary

I am not reporting a confirmed deployment vulnerability. This is a proposal for a missing SDK capability around derived data flows.

Observed API gap

The current Python classified_data_flow() and TypeScript classifiedDataFlow() classify the value being emitted and place that single result in the classification field. The event schema records one source endpoint and one destination endpoint, but it does not carry the classifications of multiple contributing source records or define how the output classification relates to them.

For a transformation such as summarization, aggregation, extraction, or memory compaction, independently classifying only the output can produce a weaker label than one of its inputs. I could not find a source-label inheritance operation in the current data-flow API.

Relevant current code:

Proposed invariant

For a configured classification taxonomy and explicit ordering:

effective = max(output_classification, source_classification_1, ..., source_classification_n)

The order must be explicit per taxonomy; arbitrary label strings must never be compared lexically. Unknown values, mixed taxonomies, missing source lineage, or duplicate source references should fail closed. The emitted event should preserve both the output classifier's observed label and the effective inherited label, with source references and labels only—never source content.

API boundary question

There are two plausible inputs:

  1. Pass source values to the SDK and have the configured classifier classify each source as well as the output. This is stronger locally, but may repeat classification work and requires the instrumentor to retain the source values.
  2. Pass source classifications already produced by a trusted DLP/policy layer. This is cheaper, but the SDK must make the trust assumption explicit and must not accept model-authored labels as authoritative.

Which boundary fits AgenTrust's intended trust model? Is this inheritance deliberately expected to happen above the telemetry SDK, or would a cross-language helper at this boundary be useful?

I would be happy to prepare a focused Python/TypeScript implementation with mirrored schema updates, shared conformance vectors, positive and negative fixtures, and changelog/docs updates once the intended input boundary is agreed.

Activity

  1. github-actions commented on Nov 19, 2026

    @github-actions

    🟡 Contributor Check: MEDIUM

    Check Result
    Profile MEDIUM
    Credential LOW
    Overall MEDIUM

    Automated check by AgenTrust Contributor Check.

  2. added
    needs-review:MEDIUM
    on Nov 19, 2026
  3. Prakash-codeMaker commented on Nov 19, 2026

    @Prakash-codeMaker
    Author

    Follow-up: I prepared a concrete additive API sketch using the second boundary discussed above—source classifications are supplied by the caller from a trusted DLP/policy label store.

    The proposed Python/TypeScript shape is:

    • SourceClassification(source, classification) for each contributing source;
    • ClassificationOrder(taxonomy, levels) with an explicit least-to-most restrictive order;
    • paired optional event fields observed_classification and source_classifications, while classification contains the effective strictest label.

    The schema requires the two lineage fields together, constrains each nested record, and caps the source list at 1,024. Runtime checks reject empty or duplicate lineage, unknown labels, mixed taxonomies, and mismatched API arguments. The event carries endpoint references and classification metadata only, never source content. Existing direct-flow calls remain unchanged.

    Important boundary: this does not authenticate source labels or prove lineage completeness; both remain caller responsibilities. It also does not implement declassification or reclassification/revocation propagation.

    I have run focused local Python and strict TypeScript checks plus schema/fixture checks. I have not run the full upstream test suites yet. Before I submit a PR, could a maintainer confirm whether this trusted-label input boundary is the preferred direction, or whether you would rather have the SDK classify source values itself?

  4. Prakash-codeMaker commented on Nov 19, 2026

    @Prakash-codeMaker
    Author

    Implementation and design record are available in draft PR #132. The PR now includes ADR 0001, schema parity checks, positive/negative conformance fixtures, and Python/TypeScript regression tests for source inheritance, strict output precedence, and tie handling. The focused data-flow suites contain 8 Python test methods and 6 TypeScript test cases. Static checks confirm the three data-flow schema copies are byte-identical and parse as JSON, and both fixtures parse. The full upstream test matrix is not run because a full checkout could not be obtained in this environment. CI, CodeQL, and ClusterFuzzLite are awaiting upstream maintainer approval (action_required); the contributor check passed at overall MEDIUM. PR remains draft pending maintainer contract/version review and CI approval.

  5. drk-ram commented on Nov 23, 2026

    @drk-ram
    Contributor

    Strong proposal. I’d lock inheritance to an explicit lattice join per taxonomy:

    effective = join(observed, source_1, …, source_n)

    where join is computed from a declared partial order (or total order if that’s the policy), never lexical string comparison.

    Edge cases I’d keep fail-closed:

    1. Mixed taxonomies in one event.
    2. Unknown label values.
    3. Duplicate source references (kind,id) that can double-count weight.
    4. Derived context declared with an empty lineage.
    5. Non-deterministic tie handling.

    Useful cross-language properties: monotonicity, idempotence, and deterministic results under source permutation. If ties are allowed, define tie-break explicitly (e.g., observed wins equal-rank ties).

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

    needs-review:MEDIUM

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions