Installation¶
hemlock ships as a single static binary with no runtime dependencies. Choose the installation method that fits your workflow.
Requirements¶
| Dependency | Version | Notes |
|---|---|---|
| Go | 1.25+ | Required for go install and building from source |
| Make | Any | Optional; used for build and release targets |
| Git | Any | Required only when building from source |
go install (Recommended)¶
The fastest path from zero to running:
This compiles the binary and places it in your $GOPATH/bin directory. Ensure that directory is on your PATH:
Pin a version
To install a specific release, replace @latest with a version tag:
Build from Source¶
Clone the repository and build with Make:
Move the binary to a directory on your PATH, or run it directly:
Cross-Compilation¶
The Makefile includes a release target that produces binaries for three platforms:
This creates the following binaries in the dist/ directory:
| File | Platform |
|---|---|
dist/hemlock-linux-amd64 |
Linux x86_64 |
dist/hemlock-darwin-arm64 |
macOS Apple Silicon |
dist/hemlock-windows-amd64.exe |
Windows x86_64 |
Custom targets
To build for a platform not covered by the release target, set GOOS and GOARCH directly:
Verify Installation¶
Confirm hemlock is installed and accessible:
Expected output:
hemlock — RAG pipeline poisoning document generator
Generates documents with hidden prompt injection payloads for testing
RAG pipeline security. Operationalizes PoisonedRAG and PhantomText research.
Usage:
hemlock [command]
Available Commands:
batch Generate full document set (all formats x all techniques)
completion Generate the autocompletion script for the specified shell
craft Generate poisoned documents
help Help about any command
list-payloads List available preset payloads
list-techniques List available hiding techniques
validate Test if payloads survive RAG processing
Flags:
-h, --help help for hemlock
Use "hemlock [command] --help" for more information about a command.
Ready to go
If you see the help output above, hemlock is installed correctly. Continue to the Quickstart to generate your first poisoned documents.