@hedge-layer/agent-h
v0.6.0
Published
Deprecated: use Agent H Desktop (https://hedgelayer.ai/docs/agent-h-desktop)
Readme
Agent H
[!WARNING] Agent H Terminal is deprecated. Version 0.6.0 is the final release and will receive no further updates. Use Agent H Desktop (Linux and Windows) or the WhatsApp pilot instead. Both use the same Hedge Layer account and token. Hedge Layer's cloud agent is now read-only, so the terminal's local approval and execution commands no longer have anything to approve.
Agent H is the terminal client for the shared Hedge Layer cloud agent. The same Strands agent runs in Amazon Bedrock AgentCore for the terminal, desktop, and future chat integrations. Hedge Layer's authenticated API owns access to it.
The cloud agent discovers Hedge Layer MCP tools, preserves the desktop's research shortlist and human selection checkpoint, and runs its Bayesian/Kelly calculation in deterministic code. File and command tools run in a separate private AgentCore Code Interpreter sandbox. The terminal keeps explicit approvals and signed venue requests local.
Setup
Requires Node.js 22.19 or newer and an interactive terminal. Install from npm; no repository access is required:
npm install -g @hedge-layer/agent-h
export AGENT_H_HEDGE_LAYER_TOKEN=hl_your_personal_api_token
agent-h doctor
agent-hCreate a personal API token in Hedge Layer account settings.
One token with read scope authenticates the cloud agent and MCP data access.
No OpenAI API key, model-provider account, or model selection is needed. Hedge
Layer manages the upstream model and its credentials. Add trade scope if you
want to submit or cancel orders after local approval.
The environment variable above keeps your Hedge Layer token out of Agent H’s
saved configuration. To save it instead, run
agent-h hedge-layer init --token <your-personal-token>.
Set AGENT_H_HEDGE_LAYER_MCP_URL, or use hedge-layer init --url, to change the
MCP endpoint and use the same origin for the cloud agent. A custom endpoint
must provide both /mcp (or your configured MCP path) and
/api/agent/v1/turns. HTTPS is required except for local loopback
development. Agent H does not use OPENAI_API_KEY, OPENAI_MODEL, or
OPENAI_BASE_URL.
Research and execution
Ask questions naturally, for example:
Find open Polymarket markets about interest rates and compare their liquidity.
Retrieve the resolution rules for this market and identify missing evidence.
Submit the Polymarket order I prepared locally.Tools explicitly marked read-only run automatically unless they are also marked
destructive or need private venue input. All other tools display their exact
arguments and wait for /approve or /reject. Each approval applies to one call.
/stop or Ctrl+C cancels a pending approval and the active turn.
Polymarket execution uses locally signed requests. Prepare a request JSON file
with your local venue SDK or signing tool; it contains the exact signed_body
and venue auth required by Hedge Layer's advertised tool schema. For order
status, the file contains order_id and auth. Wallet private keys and API
secrets stay with your local signer. The signed request and short-lived auth are
sent only to Hedge Layer and the venue.
When Agent H requests private execution input:
/load /path/to/signed-request.json
/approveLoading shows the decoded request for review while hiding credentials and signatures. Agent H sends the exact loaded snapshot after approval. Prepare the request shortly before loading it: Hedge Layer requires fresh venue authentication. The file supplies private fields locally; never paste credentials or signed request bodies into the conversation.
Agent H does not sign orders or hold wallet keys. A read-scoped Hedge Layer token
cannot execute trades; create a token with trade scope to enable execution.
Execution calls are never automatically retried. A submitted or interrupted call
may already have reached the venue; inspect order status before submitting again.
Local execution records survive failed or interrupted model turns.
Session commands
/new,/threads,/resume <id>,/status/sources— link to account-wide financial data settings/follow-up <question>,/stop/load <file>,/approve,/reject/clear,/help,/exit
Type while a response is running to queue a follow-up. The queue holds five messages. Interrupting or failing a turn discards dependent queued follow-ups. The conversation shell requires a terminal; there is no unattended execution mode.
Privacy and local state
The conversation loop, research tools, and model calls run in AWS. Prompts and redacted tool results are sent through the Hedge Layer API. The API passes your personal token to the trusted runtime for MCP authentication; the token never enters model context, conversation storage, logs, or the code sandbox.
Cloud conversation history uses AgentCore managed session storage. It expires after 14 idle days and resets on runtime deployment. The clients keep a local transcript and can restore visible text and validated shortlists into a new cloud session. Workspace files are temporary: the separate sandbox lasts one hour. Download artifacts before it expires. Stopping a command preserves existing files.
Local state stays under $XDG_CONFIG_HOME/agent-h or ~/.config/agent-h on Unix,
and %APPDATA%\agent-h on Windows. Set AGENT_H_HOME for an isolated profile.
Config and conversation files use user-only permissions where supported.
Configured secrets are redacted before display and persistence. Private venue
request files are read only through /load; their credentials are kept out of
model tool arguments and transcripts. Tool results remain untrusted data. Exact
decimal strings, units, and provider provenance pass through from Hedge Layer.
For the full setup guide, visit hedgelayer.ai/docs/agent-h.
Cloud development
The agent implementation, model harness, and Terraform/GitHub Actions deployment live in the independent private agent-h-runtime repository. See its README for deployment, the channel-neutral API, workspace downloads, test commands, and rollout. Deploy the API before distributing these clients. Existing Pi clients retain their legacy inference endpoint during rollout; the new clients do not fall back to a local agent.
Shared data sources
Use /sources in the terminal to get the Data sources settings link on your
configured Hedge Layer site. Sign in with the same account that owns your terminal
token. Selections apply across Desktop, terminal and WhatsApp for that account,
even when the clients use different tokens. WhatsApp must be linked to a token
from that same account. The command is handled locally, never sent to the model,
and does not change the active conversation or preferences itself.
Agent H refreshes its tools on the next message, and Hedge Layer enforces saved selections on new tool calls. Past results remain and requests already admitted may finish. Trading scopes and explicit approvals remain separate.
