Releases: shcherbak-ai/tethered
Releases · shcherbak-ai/tethered
v0.4.0
Immutable
release. Only release title and notes can be modified.
Added
- C extension (
_guardian.c) for tamper-resistant locked mode. Snapshots the identity
of every critical Python object at activation time and verifies integrity on every
socket event. Detects config replacement, method monkey-patching, frozen field mutation
viaobject.__setattr__, and bytecode swapping. On tamper detection, blocks ALL network
access (fail-closed) and writes a tamper alert to stderr viaos.write(fd 2). - The C extension is now required — installation fails without a C compiler (pre-built
wheels include the compiled extension for all platforms). cibuildwheelCI job builds platform-specific wheels with the compiled C extension
for Linux, macOS, and Windows across Python 3.10–3.14.- Publish workflow split into a separate GitHub Actions workflow, triggered via
workflow_runafter CI succeeds. - CodeQL now scans both Python and C/C++ code.
cppcheckstatic analysis for C code via Docker-based pre-commit hook.
Changed
- Build backend switched from
hatchlingtosetuptoolsfor native C extension support.
v0.3.3
Immutable
release. Only release title and notes can be modified.
Fixed
lock_tokennow rejects internable types (str,int,float,bytes,bool) when
locked=True. CPython interns these types, so separate literals can share identity and
defeat the lock. Useobject()or a custom instance instead.
Changed
- Moved
_reset_state()logic from production code to test fixtures.
v0.3.2
Immutable
release. Only release title and notes can be modified.
Added
- Context-local
scope()API for narrowing allowed destinations within a block of code.
Usable as both a context manager (with tethered.scope(allow=[...]):) and a decorator
(@tethered.scope(allow=[...])). Supportslog_only,fail_closed,allow_localhost,
andon_blockedoptions. Scopes use intersection semantics — they can only narrow the
global policy, never widen it. Safe for concurrent use across threads and async tasks. - Input validation on
activate()andscope()parameters (type checks forallow,
on_blocked,locked,log_only,fail_closed,allow_localhost). - Runnable examples in
examples/.
v0.2.0
Added
- Unicode NFC normalization and fullwidth dot normalization for hostnames and allow rules.
- Hostname validation rejects control characters, null bytes, and invisible Unicode.
gethostbyaddrreverse-DNS lookups are now subject to policy enforcement.
Changed
activate(locked=True)now requireslock_token(raisesValueErrorif omitted).activate()over a locked policy now requires the correctlock_token(raisesTetheredLocked).getaddrinfohook forwards all caller arguments (family, socktype, proto, flags) to C-level resolver.- Locked mode documentation clarified to better reflect the security model.
Fixed
- IP-to-hostname map now refreshes existing entries on re-resolution.
- Config and IP map updates are now atomic under nested locks.
Security
- Documented shared-IP/CDN cache mapping as a known limitation in the security model.
- Documented localhost relay risk with default
allow_localhost=Truein the security model.