Skip to main content

LoopGrid × Strands Agents

Verifiable evidence for consequential Strands agent decisions.

Strands runs the agent. LoopGrid preserves the evidence.

loopgrid-strands is a native Strands Agents Plugin that records framework lifecycle facts and explicit application evidence into LoopGrid's signed, append-only decision record.

It is intentionally not another tracing backend. Keep Strands/OpenTelemetry/your observability stack. LoopGrid adds the evidence semantics needed to prove consequential decisions: delegated authority, application policy, human review, external action evidence, observed business outcome, and cryptographic verification.

What v0.1.0 records

Source LoopGrid evidence
Strands invocation start decision_created
Successful model call model_completed
Explicit application policy policy_evaluated
Strands tool about to run tool_requested
Successful Strands tool execution tool_executed
Failed Strands tool execution tool_result
Model failure incident_flagged
Native LoopGrid review helper human_approved / human_rejected through /review
Explicit application-observed result outcome_observed

A completed agent invocation is not automatically treated as a successful business outcome.

Install

pip install loopgrid-strands

Requires Python 3.10+ and Strands Agents 1.57.1+.

Quickstart

from strands import Agent
from loopgrid_strands import LoopGridPlugin

plugin = LoopGridPlugin(
    base_url="http://127.0.0.1:8000",
    api_key="lg_live_...",
    workspace_id="default",
    authority={
        "acting_for": "Example Store",
        "scope": ["refund:create"],
        "limit_usd": 100,
    },
    policy={
        "policy_id": "refund-policy",
        "version": "1",
        "decision": "auto_allowed",
        "reason": "Within delegated threshold.",
    },
    proposed_action={"tool": "refund.create", "amount": 25, "currency": "USD"},
)

agent = Agent(plugins=[plugin], name="support-agent", tools=[...], model=...)
run_id = "case-123"
result = agent(
    "Handle this duplicate charge.",
    invocation_state={"loopgrid": {"run_id": run_id}},
)

# Only after your application has observed the real external result:
plugin.observe_outcome(
    run_id,
    {"status": "succeeded", "external_reference": "refund_123"},
)

Strands invocation state is the per-request configuration channel. It is shared across hooks/tools during one invocation and is not added to model context. In the current Python SDK, AgentResult.state is the event-loop/request-state slot rather than a mirror of arbitrary caller invocation_state, so keep the LoopGrid run_id explicitly as shown above. You may override application evidence per request:

result = agent(
    "Handle this request",
    invocation_state={
        "loopgrid": {
            "run_id": "case-456",
            "authority": {"scope": ["refund:create"], "limit_usd": 50},
            "policy": {
                "policy_id": "refund-policy",
                "version": "7",
                "decision": "auto_allowed",
                "reason": "Within delegated threshold",
            },
            "proposed_action": {"tool": "refund.create", "amount": 25, "currency": "USD"},
            "context": {"policy_bundle": "support-prod-7"},
        }
    },
)

Dynamic policy

LoopGrid does not manufacture a policy decision from a trace. If the policy is determined after a model response, your application or a separate Strands policy/intervention hook can call:

plugin.record_policy(
    run_id,
    {
        "policy_id": "refund-policy",
        "version": "7",
        "decision": "human_approval_required",
        "reason": "Amount exceeds automatic threshold",
    },
)

For a human-gated path, submit the real review through LoopGrid's native review endpoint:

plugin.review_run(run_id, "approve", "reviewer@example.com", "Checked account history")

Your application/Strands intervention remains responsible for actually blocking or permitting the tool. The LoopGrid plugin records and verifies evidence; it is not the tool executor or policy enforcement engine.

Privacy

Raw prompts, model messages, tool inputs/results, and exception text are not stored by default. The plugin records SHA-256 commitments and structural metadata. Set capture_content=True only when your privacy policy allows raw content capture.

fail_open=False is the default. For consequential workflows, evidence-write failures are surfaced rather than silently losing the record. fail_open=True is available when your application explicitly prefers availability over evidence completeness.

Deterministic no-cost validation

The repository includes a real Strands Agent runtime test and demo using a deterministic custom Model. It makes no AWS/Bedrock/OpenAI/Anthropic/Gemini call and requires no card or cloud account.

pip install -e ".[dev]"
python -m pytest -v

With LoopGrid Core running locally:

python examples/refund_gate.py

Release gate for the canonical demo:

Strands Agent
→ model_completed
→ application policy_evaluated
→ tool_requested
→ sandbox tool_executed
→ explicit outcome_observed
→ evidence_complete
→ coverage 100%
→ verify valid:true

The included refund example is sandbox-only and explicitly records real_money_moved=false.

Neutrality boundary

  • Strands Agents: runs/orchestrates the agent and tools.
  • Your application: owns delegated authority, business policy, reviews, and external outcome semantics.
  • LoopGrid: records signed evidence and verifies the resulting decision lifecycle.

Independent community integration. Not affiliated with or endorsed by Amazon Web Services or the Strands Agents project.

License

Apache-2.0.

Release files for loopgrid-strands 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loopgrid-strands 0.1.0
File Size Uploaded
loopgrid_strands-0.1.0.tar.gz 20.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for loopgrid-strands 0.1.0
File Interpreter ABI Platform
loopgrid_strands-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.0 kB

Release files / loopgrid_strands-0.1.0.tar.gz

Download URL loopgrid_strands-0.1.0.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
755d05f77d6b03d4a8409cc01b359e89cc5c89034f6b6cd01d1c21de93a4409b
BLAKE2b-256 checksum
How to use checksums
c781104aca05f785040561c0d73cd8ab6e748cbde4f8c8211c8fba31e72e0a86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / loopgrid_strands-0.1.0-py3-none-any.whl

Download URL loopgrid_strands-0.1.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8a8ee263b0b21d0cf363f06f76896ec7f3b266d65bbf41d4181590d1ae905e9
BLAKE2b-256 checksum
How to use checksums
b07b110302df3341156675d46e040cb65e803f3e1f6df82b326e5de5f1e571c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page