0166: Outbound HTTPS through curl; native TLS deferred
Status: Accepted by maintainer 2026-11-07; superseded by 0247 (accepted 2026-11-15; preserves no Harness crypto and serving TLS via proxy)
Context
The target app calls an external HTTPS API. Harness has no TLS
and must never implement crypto. The agent provider path already
speaks HTTPS through curl
(plugins/agent/transport.hn, curl_send):
config travels on stdin (--config -), so no secrets
go in argv; --proto =https, no redirects, proxies or
ambient config; raw errors are discarded.
Process.run_input exists only on the agent platform
(plugins/agent/platform.toml); the C
(hrt_proc_run_input) and interpreter
(interp_process::run_input) implementations are
shared.
Decision
- Serving stays plain HTTP on loopback; TLS terminates in an external proxy (Caddy, nginx, stunnel).
- Expose
Process.run_inputon thecliplatform: aplatform.tomlentry, the non-sandboxed cgen branch, and the test that pins it to the agent platform. http.client.fetchbuilds the hardened curl config (moved fromagent/transport.hn:config_quote,config_header, fixed flags) and runs it through a host-suppliedRunnerinterface. The library stays capability-free; the app implementsRunnerwithProcess.run_input("curl", …). Flags:--disable --silent --proto =https --max-time --max-filesize --write-out "\n%{http_code} %{content_type}". The status line is split off the last newline.- The client enforces a host allowlist and a body cap itself.
This is library policy, not OS enforcement: a sandboxed child with
a host-restricted
Netis unsupported today (runtime error 10005). - Later: native TLS through a vetted system library (libtls,
OpenSSL or BearSSL) behind FFI (ADR-0151) or bundled, with its own
ADR. Native plain-HTTP
connectfor loopback services is optional and can come first.
Consequences
HTTPS works in v1 with zero crypto code. Costs: one process
spawn per request (milliseconds), curl must be on
PATH, behavior depends on the curl version (minimum
to be pinned in the docs), and outbound host limits are advisory.
Tests use a canned Runner and a fake
curl on PATH; live calls are a manual
smoke test (ADR-0112).
Alternatives
- Native TLS now: a large security surface and a dependency, for a v1 that does not need it.
- libcurl through FFI: in-process, but needs
the
fficeiling everywhere and the ffi-host IPC underinterp. Process.runwith argv: puts headers and secrets in argv, visible inps.