Skip to main content

strands-phm-guard

Deterministic physics/bounds intervention for Strands Agents — validates tool-call arguments against a rule table before execution. No model in the loop, no external API; verdicts are recomputable from inputs alone.

The rule-table scorer behind this package is the same implementation merged into microsoft/PyRIT (PR #3507) and published on Dify Marketplace as phm-physics-check.

What it catches

Argument Value Verdict
speed 4e9 m/s VETO — exceeds c
power -50 W VETO — negative
rpm inf VETO — not finite
speed 100 m/s PASS

Install

pip install strands-phm-guard

Use (Strands Agents SDK >= 1.64)

from strands_phm_guard import PhysicsGuard

guard = PhysicsGuard(mode="deny")   # or mode="guide" for soft correction

# pass via Agent(interventions=[guard]) - see Strands interventions docs

Three-state exit:

  • PASS → Proceed() (tool call dispatched)
  • DEGRADE → Guide(message=...) (model gets the violation list and can self-correct)
  • VETO → Deny(reason=...) (physically impossible call blocked before execution)

Stats are exposed as recomputable counters: guard.stats.as_dict().

Tests

pip install phm-lite-check pytest
pytest tests/ -q

16 tests, no network, fully deterministic.

Scope note

This is a thin rule-table layer: it validates numeric argument bounds (speed-of-light ceiling, negative-physical-quantity rejection, non-finite rejection, configurable per-argument hard limits). It does not parse natural language and does not call any model.

Related proposal: strands-agents/harness-sdk#5934.

Metadata

Release files for strands-phm-guard 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 strands-phm-guard 0.1.0
File Size Uploaded Provenance Actions
strands_phm_guard-0.1.0.tar.gz 5.5 kB Without provenance Details for strands_phm_guard-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for strands-phm-guard 0.1.0
File Interpreter ABI Platform Actions
strands_phm_guard-0.1.0-py3-none-any.whl Python 3 none any Details for strands_phm_guard-0.1.0-py3-none-any.whl

Total release size: 11.0 kB

Release files / strands_phm_guard-0.1.0.tar.gz

Download URL strands_phm_guard-0.1.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
932ce9237e6611937fb79a7dd03c7a51efa537e921f7742f56103664e0d990dc
BLAKE2b-256 checksum
How to use checksums
9d6ebb67df79b8ca369e7103848912870fc08f82b69c4849f5699a0b7e79631b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

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

Download URL strands_phm_guard-0.1.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ead18986704d5112236f79b6167996d043aebe735a8d4fa6eb36ab0d8bf4026e
BLAKE2b-256 checksum
How to use checksums
f2c327abaf4681ad77d25ce29d71513807934b4efbcf56a47651fe1ae0d90bd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for strands-phm-guard 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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