Agent Signal lab — 30 October 2026. Status: documentation-reviewed, NOT executed by this publication.
What it tests
Charter is an Apache-2.0 Python library whose tool declarations enforce input fields and permissions before an outbound API request is made. On 29 October, v0.6.0 added context-aware calls and more precise OAuth-scope handling. This lab gives the model control over an order ID but fixes the current customer in trusted application context. It deliberately asks for another customer's order and expects a refusal without any HTTP request or LLM inference.
The lesson: tenant ownership must be an executable rule, not just words in a system prompt. This example tests the local input boundary, not the security of real API tokens or a complete multi-tenant system.
Prerequisites, access and costs
- Python 3.10 or newer,
venv,pipand internet access for the one-time package download. - A disposable directory and no sensitive files. Charter is free and Apache-2.0 licensed; it runs in your process, and v0.6.0 requires
pydantic>=2.12.3,<3andhttpx>=0.27,<1. - No model API key, GitHub Actions run, GPU or paid service. The code below contains only invented customer/order IDs and a non-secret dummy Authorization string. The intended invalid call is rejected locally before HTTP; do not change it to a permitted call while using this lab.
- The publication itself is cloud-based. This optional lab is for readers who choose to try it in their own disposable environment.
Step 1 — Create a clean environment
python3 --version
python3 -m venv charter-lab-venv
. charter-lab-venv/bin/activate
python -m pip install 'charter-ai==0.6.0'
python -m pip show charter-aiIf the exact tagged package cannot be resolved from your index, do not silently substitute another project called Charter. Check the canonical r28ai/charter packaging and releases and record the version instead of inventing a successful install.
Step 2 — Build the intentionally forbidden request
Save the following as deny_cross_customer.py. It performs only the forbidden local validation path and never attempts an allowed request.
from typing import Annotated
from pydantic import BaseModel, model_validator
from charter import FromContext, Path, ToolValidationError, api_key_tool_factory, format_egress_map
OWNERS = {"ord_1": "cus_42", "ord_2": "cus_7"}
class GetOrder(BaseModel):
order_id: Annotated[str, Path()]
customer_id: Annotated[str, FromContext()]
@model_validator(mode="after")
def only_current_customer(self) -> "GetOrder":
if OWNERS.get(self.order_id) != self.customer_id:
raise ValueError("That order belongs to another customer.")
return self
shop = api_key_tool_factory(
pack="shop",
base_url="https://httpbin.org/anything/",
api_key_headers={"Authorization": "Bearer example-never-used"},
)
get_order = shop(
name="orders_get",
description="Get a customer's order",
method="GET",
url_template="v1/orders/{order_id}",
args_schema=GetOrder,
)
try:
get_order.invoke({"order_id": "ord_2"}, context={"customer_id": "cus_42"})
raise AssertionError("FAIL: cross-customer call was not rejected")
except ToolValidationError as exc:
print("REFUSED:", exc.errors[0]["msg"])
print(format_egress_map([get_order]))Run:
python deny_cross_customer.pyExpected output — illustrative, not measured here
Expect an error containing That order belongs to another customer, and an egress map indicating that the model can specify order_id while customer_id is withheld and supplied from application context. The HTTP placeholder is not contacted in the intentional refusal path. Exact error punctuation may vary; a clean result means the process exits normally after catching a ToolValidationError.
If the command attempts a network call, do not treat it as a pass: stop and inspect the package version and code before proceeding. No model-generated output is expected.
Score the boundary (0–5)
Award one point for each independently observed check:
- The installed package is the correct
charter-aifromr28ai/charter, version 0.6.0. - The requested
ord_2belongs tocus_7, not the trustedcus_42. - An actual
ToolValidationErroris caught; the explicit failureAssertionErroris never raised. customer_idappears withheld in the egress map, not editable by the model.- You have evidence that no HTTP request was sent and you did not supply a real API credential.
A score below five means the local boundary demonstration is incomplete, not proof of exploitable production security.
Troubleshooting
python3unavailable: install Python 3.10+ or use a compatible disposable environment.- Install failure: check network access and that
charter-aiis available from the expected publisher; never install lookalike packages without checking. - Pydantic error: verify installed
pydantic>=2.12.3,<3and the exact Charter version. ToolValidationErrornot caught: inspect the error type and confirm you copied thecontextargument and@model_validatormethod.- Model can set customer ID: verify
FromContext()is attached tocustomer_id, and inspectformat_egress_map. - Any outbound HTTP or credential prompt: stop; you should be running only the forbidden request against synthetic data.
What was verified by the editor
The canonical README, tagged v0.6.0 release, Python requirements and Apache-2.0 license were reviewed on 30 October 2026. Not executed: package installation, test script, API request, network capture, model run or GitHub Actions workflow. There are no observed results or paid services to report.