a207-policy
A207 统一身份注入 / 权限矩阵 / 状态路径策略包(Plan A 单一事实源)。
13 个 MCP 统一依赖本包,取代原先散落在 M1/M2/M4/M11/M13 的多份权限副本。
用法
from a207_policy import get_caller, enforce_read, enforce_write, LIS_READ_FULL
def get_labs(patient_id: str) -> dict:
caller = get_caller() # 来自 env A207_CALLER,模型碰不到
enforce_read("a207-lis-mcp") # 确定性拒绝越权(fail-closed)
...
- 身份注入:
A207_CALLER环境变量由部署配置写入,模型无法自证(修复 P0-1)。 - 测试:
from a207_policy import set_caller; set_caller("doctor_assistant")。 - 状态路径:
from a207_policy import resolve_state_path; resolve_state_path("followup_store.json")落到A207_DATA_DIR或系统临时目录,避免只读安装目录崩溃(修复 P1-3)。
Metadata
Release files for a207-policy 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| a207_policy-0.2.2.tar.gz | 17.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| a207_policy-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.0 kB
Release files / a207_policy-0.2.2.tar.gz
| Download URL | a207_policy-0.2.2.tar.gz |
|---|---|
| Size | 17.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
722e72c03916d00e39a35f611682d9de72d41f663452a7a9eec60c17b2d2cb10
|
|
BLAKE2b-256 checksum How to use checksums |
b45f4b0e32746b16e3634fc228091f9776fcef357b0e549bb1f8dd59d650ebf4
|
| 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 Aug 10, 2026.
Transparency logRelease files / a207_policy-0.2.2-py3-none-any.whl
| Download URL | a207_policy-0.2.2-py3-none-any.whl |
|---|---|
| Size | 16.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
215fe7c8d27d400f3bb334524678ec518678bf94ab6eb63203cd3ff1574ed3e8
|
|
BLAKE2b-256 checksum How to use checksums |
f87c94607a358114aa7d6c48d2cd7c40ed6f91bc5d980f997a158f2abfa57279
|
| 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 Aug 10, 2026.
Transparency log