Skip to content

Deeper Strands integration: in-process check_agent_result() API #12

Description

@bamdadd

Right now the only entry point is the CLI reading a file off disk (taintline check <path>). For a Strands user the natural gate is in-process: run the agent, get an AgentResult, and check it without serializing to a temp file. Add a small typed public API that turns a Strands AgentResult (or its .traces) directly into a Verdict. This must preserve the core invariant: the check path runs the same deterministic detectors with NO LLM judge, no network, no clock, no RNG.

Acceptance criteria

  • A public function (e.g. taintline.check_agent_result(result) -> Verdict) normalizes a Strands AgentResult/traces object through the existing ingest path and calls run_all — reusing, not duplicating, detector logic.
  • Typed signature (pydantic types / defined Protocol for the accepted input; no loose dicts), mypy strict clean; Strands is an optional/duck-typed dependency so importing taintline never hard-requires it.
  • A convenience that maps a Verdict to a pass/fail against a caller-supplied fail_on set, mirroring CLI --fail-on, so it is usable as a hard gate in a script.
  • Documented in the README Strands section with a short domain-neutral example.
  • Tests cover a tainted and a clean AgentResult-shaped input and assert deterministic verdicts; no network, no LLM in the path.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions