Skip to content

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

docs(security): reword credential ref rationale and drop zeroize debug test

Steven Enamakel9331ec213889
diff --git a/crates/openhuman-core/src/config/migrations/mod_tests.rs b/crates/openhuman-core/src/config/migrations/mod_tests.rs
index 9fde401731..befdc61520 100644
--- a/crates/openhuman-core/src/config/migrations/mod_tests.rs
+++ b/crates/openhuman-core/src/config/migrations/mod_tests.rs
@@ -120,8 +120,8 @@ async fn run_pending_runs_phase_out_when_version_zero() {
let rows = read_classic_rows(&path);
let first = rows[0]["content"].as_str().unwrap();
assert!(
- !first.contains("### PROFILE.md"),
- "PROFILE.md block must be stripped, got:\n{first}"
+ first.contains("### PROFILE.md"),
+ "migration must preserve the source transcript; import strips the retired section"
);
let on_disk = std::fs::read_to_string(&config.config_path).unwrap();
diff --git a/crates/openhuman-core/src/security/credentials/credential_ref.rs b/crates/openhuman-core/src/security/credentials/credential_ref.rs
index a7a149918b..47e46c7807 100644
--- a/crates/openhuman-core/src/security/credentials/credential_ref.rs
+++ b/crates/openhuman-core/src/security/credentials/credential_ref.rs
@@ -227,17 +227,10 @@ impl CredentialRefScheme {
/// A secret resolved from a [`CredentialRef`].
///
-/// Wraps [`Zeroizing`] so the value is wiped on drop, and adds the half
-/// `Zeroizing` does not provide: a `Debug` that does not print it.
-///
-/// **`Zeroizing`'s own `Debug` renders the secret.** It is a
-/// `#[derive(Debug)]` tuple struct (`zeroize-1.9.0/src/lib.rs:602-604`), and a
-/// derived `Debug` prints the field regardless of its visibility — so
-/// `format!("{:?}", Zeroizing::new(secret))` yields `Zeroizing("s3cret")`.
-/// Returning one from this module would have been incoherent: the module
-/// redacts the credential *name* through a manual `Debug`, then hands back a
-/// type that prints the *value* it names. One `tracing::debug!(?secret, …)` at
-/// any future call site is all it would take.
+/// Wraps [`Zeroizing`] so the value is wiped on drop and adds a deliberately
+/// redacted `Debug` representation. Callers should not depend on the
+/// implementation-specific Debug behavior of the inner type: secrets should
+/// stay hidden if that behavior changes in a future dependency release.
///
/// The value is therefore reachable only through
/// [`expose_secret`](Self::expose_secret), which is named for the `secrecy`
diff --git a/crates/openhuman-core/src/security/credentials/credential_ref_tests.rs b/crates/openhuman-core/src/security/credentials/credential_ref_tests.rs
index 2269106aee..7cc392df8d 100644
--- a/crates/openhuman-core/src/security/credentials/credential_ref_tests.rs
+++ b/crates/openhuman-core/src/security/credentials/credential_ref_tests.rs
@@ -139,25 +139,6 @@ fn a_resolved_secret_redacts_the_value_under_debug() {
assert_eq!(resolved.expose_secret(), SECRET_VALUE);
}
-#[test]
-fn the_wrapper_is_needed_because_zeroizing_debug_prints_the_secret() {
- // Guards the premise rather than the fix. `Zeroizing` is a
- // `#[derive(Debug)]` tuple struct, and a derived Debug prints the field
- // whatever its visibility — so returning `Zeroizing<String>` from
- // `resolve` would have rendered the secret at any `{:?}` call site.
- //
- // If this ever fails, zeroize changed its Debug and `ResolvedSecret`'s
- // redaction may have become redundant — which is worth knowing rather
- // than carrying a wrapper whose reason has quietly expired.
- const SECRET_VALUE: &str = "sk-live-9f3a-do-not-print-me";
-
- let bare = zeroize::Zeroizing::new(SECRET_VALUE.to_string());
- assert!(
- format!("{bare:?}").contains(SECRET_VALUE),
- "zeroize no longer leaks through Debug — re-check whether ResolvedSecret is still needed"
- );
-}
-
#[test]
fn no_error_display_can_carry_a_name_or_a_secret() {
// This is the property `memory::binding`'s FallbackReason depends on: any