{% extends "base.html" %} {% block body %}

Rust · Python · MIT

AWS Session Manager,
as a library.

Open sessions, stream bytes and forward ports from inside your own async application. No session-manager-plugin binary, no subprocess, no scraping stdout.

cargo add aws-ssm-bridge or pip install aws-ssm-bridge
{{ ("```rust\n" ~ load_data(path="snippets/quickstart.rs", format="plain") ~ "```") | markdown | safe }}

What you get

Shell & command sessions

Interactive shells, plus both AWS-Start*Command documents, with typed wrappers so a wrong parameter name is a compile error.

Port forwarding

smux-multiplexed, so many concurrent TCP connections share one WebSocket without blocking or corrupting each other.

KMS session encryption

AES-256-GCM end-to-end for accounts that mandate it. A client that cannot negotiate it fails the handshake rather than downgrading.

Interactive terminal

Raw byte passthrough, SIGWINCH resize, and terminal restoration on every exit path — panics included.

Reconnection

An output stream that outlives the session beneath it, rebuilt with full-jitter backoff when — and only when — a retry could help.

Python bindings

The full async API with type stubs and context managers, shipped as an abi3 wheel for CPython 3.8 and later.

One guarantee everything else rests on

A session is either running or closed. Every way it can end — a clean terminate(), the agent hanging up, a dead network, a protocol violation — resolves closed() and records a CloseReason.

That is what makes the layers above it work: the port forwarder stops accepting when the tunnel dies, the pool reaps dead entries, and reconnection knows when to rebuild. There is no state in which the handle looks alive but nothing is running.

How it is put together

{{ ("```rust\n" ~ load_data(path="snippets/closed.rs", format="plain") ~ "```") | markdown | safe }}

Built to be verified, not trusted

forbid unsafe_code is forbidden crate-wide
Fuzzed Every parser that touches network bytes
Verified SHA-256 payload digests, like the reference plugin
Pinned Wire format locked by byte-offset tests

The data channel refuses any endpoint that is not an AWS SSM messages host, and the session token travels only in the open message — never in a URL, where proxies and traces would record it. Read the threat model

Start here

Not affiliated with AWS. This is an independent implementation of a protocol documented by observation, not endorsed or sponsored by Amazon Web Services, Inc.

{% endblock body %}