Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(embed): add error variant for insecure bearer credential routes

Steven Enamakel0413f05eff52
diff --git a/src/embed/error.rs b/src/embed/error.rs
index 4d11144047..6bab800182 100644
--- a/src/embed/error.rs
+++ b/src/embed/error.rs
@@ -85,6 +85,17 @@ pub enum CoreError {
#[source]
source: serde_json::Error,
},
+
+ /// The route would transmit a bearer credential over a non-TLS channel.
+ ///
+ /// A [`super::agent::Route`] that names an `http://` (or other non-HTTPS)
+ /// endpoint while carrying an `api_key` is refused before any request is
+ /// sent, so the credential can never ride cleartext on the wire.
+ #[error("{endpoint}: refusing to send a bearer credential over a non-HTTPS route")]
+ InsecureRoute {
+ /// The sanitized endpoint (credentials stripped) that was refused.
+ endpoint: String,
+ },
}
impl CoreError {