Skip to main content

muad-skill-http

Trace-aware HTTP helpers and runtime instrumentation for muad skills.

Business skills keep using import requests. In the runtime image a .pth startup hook imports muad_skill_http.compat, which patches requests.Session.request only when Runtime Guard injects MUAD_REQUESTS_COMPAT=1 and a non-empty MUAD_BUSINESS_HOSTS allowlist. Only requests whose URL host:port exactly matches an allowlisted business host are instrumented: TraceId and X-Csrftoken are overwritten with fresh UUID v4 values and the request is counted against the execution limit. Every other request passes through untouched. Skill code does not import the SDK.

Install

pip install muad-skill-http

Usage

import requests

response = requests.get(
    "https://demo.example.internal/api/v1/targets",
    headers={"Cookie": cookie_header},
)

Runtime Guard then adds the tracing/CSRF headers and records the request.

get / post / put / patch / delete / head / options / request / session are also exported as thin requests wrappers that record request counts for the current skill execution. They are optional; plain requests calls are instrumented by the compat layer.

Local development: build a state file from browser cookies

build_local_state converts the Cookie request header copied from browser DevTools into the state JSON the skill template reads from ~/.muad-local/session-state.json. It also writes the cookies into storageState; cookie values are never logged.

import json

from muad_skill_http import build_local_state

state = build_local_state(
    "demo",
    "Cookie: session=...; csrf_token=...",
    base_url="https://demo.example.internal",
    host_header={"Host": "demo.example.internal"},
    csrf=[{"cookie": "csrf_token", "header": "x-csrftoken"}],
)
with open("/home/me/.muad-local/session-state.json", "w", encoding="utf-8") as handle:
    json.dump(state, handle)

Multiple platforms can share one file with merge_local_states:

from muad_skill_http import build_local_state, merge_local_states

state = merge_local_states(
    build_local_state("mssw", mssw_cookie_header, base_url="https://mssw.example.internal"),
    build_local_state("mssp", mssp_cookie_header, base_url="https://mssp.example.internal"),
)

cookies_from_header("a=1; b=2") returns just the parsed cookie list. These helpers are for local development only; production sessions come from session-manager get-state. The skill template reads ~/.muad-local/session-state.json when MUAD_SESSION_KEY is absent, so local runs do not need a session-manager binary. Never commit a filled-in state file.

Environment variables

Variable Purpose
MUAD_REQUESTS_COMPAT 1 enables the requests instrumentation. Runtime Guard injects it.
MUAD_BUSINESS_HOSTS Comma-separated host:port allowlist. Only these hosts are instrumented. Runtime Guard injects the pod-wide union of enabled platform baseUrl hosts.
MUAD_TRACE_SPOOL Optional JSONL trace spool path; paired with MUAD_EXECUTION_ID.
MUAD_EXECUTION_ID Execution id written to the trace spool.
MUAD_SKILL_REQUEST_LIMIT Per-execution interface request limit; unset or 0 means unlimited. Exceeding the limit exits with code 86.

I/O failures while writing the trace spool are swallowed: auditing never breaks a skill request.

Development

python -m pytest test

Releases are published by pushing an sdk-v* tag; the tag must match project.version in pyproject.toml.

Metadata

Release files for muad-skill-http 0.3.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 muad-skill-http 0.3.0
File Size Uploaded Provenance Actions
muad_skill_http-0.3.0.tar.gz 15.9 kB With provenance Details for muad_skill_http-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for muad-skill-http 0.3.0
File Interpreter ABI Platform Actions
muad_skill_http-0.3.0-py3-none-any.whl Python 3 none any Details for muad_skill_http-0.3.0-py3-none-any.whl

Total release size: 27.9 kB

Release files / muad_skill_http-0.3.0.tar.gz

Download URL muad_skill_http-0.3.0.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cc14e9341b843ba25fde221c504ad87bd969e3ba0b6f0ad7a53b711da842456e
BLAKE2b-256 checksum
How to use checksums
429366479216dbf84128b95d4e4a4ff3e222619fb15f846b47de07e879e58711
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 Oct 19, 2026.

Transparency log

Release files / muad_skill_http-0.3.0-py3-none-any.whl

Download URL muad_skill_http-0.3.0-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63175bf47f1bf7ca95066245838055e3fb8010ea608b13000d1104b32b594191
BLAKE2b-256 checksum
How to use checksums
75781e681d1fec422d68e4e22e5cbd17b9e06bce8e5a7fe624dce1cbc81555fb
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 Oct 19, 2026.

Transparency log

Security for muad-skill-http 0.3.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for muad_skill_http-0.3.0.tar.gz

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 Oct 19, 2026.

Transparency log

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