Skip to content

OPA adapter raises TypeError, not ValueError, when a result mapper returns a dict or list #75

Closed

Description

@imran-siddique

Checked at 986e87e. Found by rajnisht7 in review of #73.

src/agentrust_telemetry/adapters/opa.py:38 checks the mapper's return value with decision not in {"allow", "deny", "challenge", "not_applicable", "error"}. A set membership test needs a hashable value, so a result_mapper that returns a dict or a list raises TypeError: unhashable type instead of the adapter's own ValueError("OPA result mapper returned unsupported decision: ..."). Every other bad mapper result already gets that ValueError.

Done when

  • a mapper returning {} or [] raises the same ValueError as an unsupported string
  • a test in tests/test_adapters.py covers both, and fails on 986e87e

Files: src/agentrust_telemetry/adapters/opa.py, tests/test_adapters.py.

Activity

  1. added a commit that references this issue on Oct 2, 2026
    aa71016
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions