bytedance/deer-flow · error · ValueError
mem0 allow_insecure_http must be a boolean
Error message
mem0 allow_insecure_http must be a boolean
What it means
Raised by Mem0Config.from_backend_config when memory.backend_config.allow_insecure_http is present but is not a Python bool. The flag opts into sending the API token over plaintext http:// base URLs and is checked with isinstance(x, bool) so that truthy strings ('true', 'yes') or integers (1) cannot silently enable an insecure posture via YAML coercion ambiguity.
Source
Thrown at backend/packages/harness/deerflow/agents/memory/backends/mem0/config.py:82
"allow_insecure_http",
"top_k",
"score_threshold",
"max_injection_chars",
"timeout_seconds",
"startup_policy",
}
- _HOST_INJECTED_KEYS
)
if unknown:
raise ValueError(f"mem0 backend_config has unknown keys: {sorted(unknown)}")
if not isinstance(failure_policy, dict):
raise ValueError("mem0 failure_policy must be a mapping {read, write}")
unknown_fp = set(failure_policy) - {"read", "write"}
if unknown_fp:
raise ValueError(f"mem0 failure_policy has unknown keys: {sorted(unknown_fp)}")
allow_insecure_http = cfg.get("allow_insecure_http", False)
if not isinstance(allow_insecure_http, bool):
raise ValueError("mem0 allow_insecure_http must be a boolean")
config = cls(
api_key_env=str(cfg.get("api_key_env", "MEM0_API_KEY")),
base_url=str(cfg.get("base_url", "https://api.mem0.ai")).rstrip("/"),
allow_insecure_http=allow_insecure_http,
top_k=int(cfg.get("top_k", 8)),
score_threshold=float(cfg.get("score_threshold", 0.1)),
max_injection_chars=int(cfg.get("max_injection_chars", 12000)),
timeout_seconds=float(cfg.get("timeout_seconds", 10.0)),
startup_policy=str(cfg.get("startup_policy", "fail_fast")),
read_policy=str(failure_policy.get("read", "fail_open")),
write_policy=str(failure_policy.get("write", "log_and_drop")),
)
if config.startup_policy not in _STARTUP_POLICIES:
raise ValueError(f"mem0 startup_policy must be one of {sorted(_STARTUP_POLICIES)}")
if config.read_policy not in _READ_POLICIES:
raise ValueError(f"mem0 failure_policy.read must be one of {sorted(_READ_POLICIES)}")
if config.write_policy not in _WRITE_POLICIES:View on GitHub (pinned to 1dd6ba1acb)
Solutions
- Write the value as a bare YAML boolean: allow_insecure_http: true (or false)
- If a template renders config, make sure it emits a real boolean, not a quoted string
- Reconsider whether you need the flag at all — prefer an https base_url
Example fix
# before (config.yaml)
memory:
backend_config:
base_url: http://localhost:8080
allow_insecure_http: "true" # string -> ValueError
# after
memory:
backend_config:
base_url: http://localhost:8080
allow_insecure_http: true Defensive patterns
Strategy: type-guard
Validate before calling
def allow_insecure_shape_ok(backend_config: dict) -> bool:
v = (backend_config or {}).get("allow_insecure_http", False)
return isinstance(v, bool) Type guard
def is_strict_bool(v: object) -> bool:
"""allow_insecure_http is checked with isinstance(v, bool): quoted 'true' / 1 are rejected."""
return isinstance(v, bool) Prevention
- Emit booleans unquoted in YAML/JSON config pipelines (Helm values, JSON injection)
- Prefer fixing base_url to https over enabling allow_insecure_http at all
When it happens
Trigger: Writing allow_insecure_http: "true" (quoted string), allow_insecure_http: 1, or allow_insecure_http: 'yes' (a quoted string; unquoted yes/no/on/off do parse as bool in YAML 1.1) in backend_config.
Common situations: Config generated by Helm/templates that quotes all values; JSON-based config injection that serializes booleans as strings; hand-editing where the value was quoted for safety.
Related errors
- mem0 backend_config has unknown keys: {sorted(unknown)}
- mem0 failure_policy must be a mapping {read, write}
- mem0 failure_policy has unknown keys: {sorted(unknown_fp)}
- mem0 startup_policy must be one of {sorted(_STARTUP_POLICIES
- mem0 failure_policy.read must be one of {sorted(_READ_POLICI
AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14).
Data as JSON: /api/errors/346f1d9cf94d51a5.
Report an issue: GitHub.