Files
zeekayandHanzo Dev 25204cb8a9 ci: publish the API reference through our own Sites plane, not GitHub Pages
.github/workflows/pages.yml ran `cargo doc` and handed target/doc to
actions/deploy-pages. That is a deploy plane outside our CI/CD, outside the
Sites plane and outside our analytics, and it never worked:
hanzoai.github.io/guard answers 404 and every "Deploy Docs" run on this repo has
failed. This crate has had no live API reference at all.

.hanzo/workflows/deploy.yml replaces it with the shape hanzoai/hips already
proves: build the export, POST /v1/projects/guard/deploy, sync the bytes
straight to the S3 prefix cloud names in the 202, then flip the deployment live
— and mark it error if the run dies after enqueueing, so cloud never records a
deployment as "queued" forever. It runs on hanzo-build-linux-amd64, which is a
label the forge runners actually advertise; a label nothing answers does not
fail, it queues silently until the 24h timeout. The toolchain comes from rustup
rather than dtolnay/rust-toolchain, which resolves through the Actions
marketplace the forge runner does not reach.

The root redirect is asserted, not assumed: rustdoc writes no index at the root,
so / would 404 without the hop, and the hop must name hanzo_guard because cargo
replaces the hyphen and a redirect to the hyphenated crate name 404s. The build
gate checks that file exists before writing it.

Analytics is the ONE hosted tag (cloud apps/analytics/tag.go) posting to
POST /v1/event — no GA, no second tracker. Verified against a real export: 74 of
75 rustdoc pages take the tag, the one exception being the redirect stub, which
has no <head> and nothing to measure. Its key is read from the project this run
deploys, so pk- rotation is one server-side change rather than five repo edits,
and no key means no tag: a keyless beacon is accepted 200 into $public, a tenant
this org cannot read.

Cargo.toml's homepage pointed at hanzoai.github.io/guard, which 404s; it now
names the host that serves the reference.

ci.yml is untouched, including its own `cargo doc` job — that one is a compile
check on the doc comments, not a publish.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-04 18:25:16 -07:00

81 lines
2.2 KiB
TOML

[package]
name = "hanzo-guard"
version = "0.1.3"
edition = "2021"
authors = ["Hanzo AI <[email protected]>"]
description = "Fast LLM I/O sanitization - PII redaction, prompt injection detection, rate limiting"
license = "MIT OR Apache-2.0"
repository = "https://github.com/hanzoai/guard"
homepage = "https://guard.hanzo.app"
documentation = "https://docs.rs/hanzo-guard"
readme = "README.md"
keywords = ["llm", "sanitization", "pii", "security", "ai"]
categories = ["development-tools", "web-programming", "text-processing"]
[features]
default = ["pii", "rate-limit", "audit"]
pii = ["regex"]
rate-limit = ["governor"]
content-filter = ["reqwest"]
audit = ["tracing"]
proxy = ["hyper", "hyper-util", "http-body-util", "tower", "tower-http"]
pty = ["portable-pty"]
full = ["pii", "rate-limit", "content-filter", "audit", "proxy", "pty"]
[dependencies]
thiserror = "2.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
async-trait = "0.1"
tokio = { version = "1", features = ["full"] }
futures = "0.3"
# UUID and timestamps
uuid = { version = "1.0", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde"] }
# PII detection
regex = { version = "1.10", optional = true }
# Rate limiting
governor = { version = "0.8", optional = true }
# Content filtering (external API)
reqwest = { version = "0.12", features = ["json"], optional = true }
# Audit logging
tracing = { version = "0.1", optional = true }
# HTTP Proxy
hyper = { version = "1.5", features = ["full"], optional = true }
hyper-util = { version = "0.1", features = ["full"], optional = true }
http-body-util = { version = "0.1", optional = true }
tower = { version = "0.5", optional = true }
tower-http = { version = "0.6", features = ["trace"], optional = true }
# PTY wrapper (rlwrap-style)
portable-pty = { version = "0.8", optional = true }
[dev-dependencies]
tokio-test = "0.4"
[[bin]]
name = "hanzo-guard"
path = "src/main.rs"
required-features = ["full"]
[[bin]]
name = "guard-proxy"
path = "src/bin/proxy.rs"
required-features = ["proxy"]
[[bin]]
name = "guard-wrap"
path = "src/bin/wrap.rs"
required-features = ["pty"]
[[bin]]
name = "guard-mcp"
path = "src/bin/mcp_proxy.rs"
required-features = ["pii"]