Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3f4fc77
fix(runtime): keep proxy credentials out of OpenClaw state
prekshivyas Sep 22, 2026
5c0542d
fix(runtime): harden auth profile cleanup path
prekshivyas Sep 22, 2026
b8bd2b6
fix(runtime): complete credential boundary validation
prekshivyas Sep 22, 2026
d79c1cf
fix(runtime): bind resolver and startup contracts
prekshivyas Sep 22, 2026
6903dec
test(e2e): retry empty provider responses
prekshivyas Sep 23, 2026
4eca3dc
test(e2e): classify wrapped empty responses
prekshivyas Sep 23, 2026
6a5ca6b
test(e2e): preserve wrapped provider diagnostics
prekshivyas Sep 23, 2026
167fa5d
test(e2e): retry transient sandbox inference
prekshivyas Sep 23, 2026
791ae55
test(e2e): preserve Podman context for Hermes ACP recovery
deepujain Sep 23, 2026
29b62ca
test(runtime): consolidate auth and retry regression coverage
ericksoa Sep 23, 2026
0ddadd9
test(e2e): retain bounded Hermes ACP startup diagnostics
deepujain Sep 23, 2026
a78284f
merge: include approved OpenClaw fixture prerequisites
ericksoa Sep 23, 2026
f1db46a
fix(gateway): preserve host runtime during selected recovery
deepujain Sep 23, 2026
4e3886d
fix(runtime): clear managed credentials before startup helpers
ericksoa Sep 23, 2026
9e28a3f
test(hermes): recognize exact Podman export refusal
deepujain Sep 23, 2026
279826e
merge: integrate required gateway cleanup prerequisite
deepujain Sep 23, 2026
db200be
fix(runtime): recognize the managed inference default port
ericksoa Sep 23, 2026
9db5560
fix(runtime): reconcile managed profiles before root doctor
ericksoa Sep 23, 2026
ab77d25
test(e2e): reject unexplained empty assistant responses
ericksoa Sep 23, 2026
e1ab9d0
test(e2e): keep provider diagnostics portable
ericksoa Sep 23, 2026
35dbb13
test(runtime): reuse doctor fixture for configured providers
ericksoa Sep 23, 2026
100f766
fix(runtime): recognize native Podman gateway readiness
ericksoa Sep 23, 2026
a10a21a
merge: include selected Podman recovery fixes for qualification
ericksoa Sep 23, 2026
431f908
merge: include trusted bootstrap validation prerequisite
ericksoa Sep 23, 2026
00899ca
fix(runtime): retain Podman context through lifecycle scopes
ericksoa Sep 23, 2026
107b003
fix(runtime): bind service readiness to the selected socket
ericksoa Sep 23, 2026
efeed69
fix(runtime): retain managed loopback endpoint aliases
ericksoa Sep 23, 2026
aa17fbf
fix(runtime): bind service readiness and retain portable context
ericksoa Sep 23, 2026
a5d13d7
fix(runtime): recognize managed inference URLs regardless of case
ericksoa Sep 23, 2026
52486b2
fix(runtime): retain diagnostics when maintenance release stalls
ericksoa Sep 23, 2026
72668a9
Merge remote-tracking branch 'origin/main' into fix/pr12237-podman-fa…
ericksoa Sep 23, 2026
9406f8b
fix(e2e): recognize native provider error status prefixes
ericksoa Sep 23, 2026
4206fe6
fix(runtime): preserve recovery diagnostics across exec failures
ericksoa Sep 23, 2026
bb0ea60
fix(runtime): retain complete diagnostic lines and native errors
ericksoa Sep 23, 2026
1beb47d
refactor: separate Podman recovery from the credential fix
ericksoa Sep 23, 2026
dc57c37
test: keep the credential fix out of unrelated E2E metadata
ericksoa Sep 23, 2026
b9974fd
fix(openclaw): reject FIFO auth profiles without blocking startup
ericksoa Sep 23, 2026
262ef25
fix(openclaw): preserve direct profiles until Doctor migration
ericksoa Sep 23, 2026
e71bc97
docs: clarify the credential test coverage boundary
ericksoa Sep 23, 2026
e21c1e9
docs(security): remove an overbroad direct-profile claim
ericksoa Sep 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/test-file-size-budget.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"src/lib/onboard/preflight.test.ts": 1875,
"test/generation/generate-openclaw-config.test.ts": 1844,
"test/installer-integration/install-preflight.test.ts": 2995,
"test/agents/openclaw/runtime/nemoclaw-start.test.ts": 4309,
"test/agents/openclaw/runtime/nemoclaw-start.test.ts": 4187,
"test/onboarding/onboard-messaging.test.ts": 1960,
"test/onboarding/onboard-selection.test.ts": 4125
}
Expand Down
9 changes: 6 additions & 3 deletions docs/security/process-controls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,15 @@ A registry-side tag change cannot silently select another managed sandbox image.

## Auth Profile Permissions

The entrypoint and migration flows enforce `chmod 600` on all `auth-profiles.json` files under `~/.openclaw`.
This prevents other users on the host from reading stored credentials.
For managed `inference.local` routes, the entrypoint clears the NVIDIA credential aliases before setup and command execution.
It removes only the exact legacy NemoClaw-generated profile for the selected managed provider and preserves other profiles.
Direct inference routes outside `inference.local` retain supplied credentials.
The entrypoint and migration flows enforce `chmod 600` on auth-profile files under `~/.openclaw`.
This prevents other users on the host from reading stored credentials that remain.

| Aspect | Detail |
|---|---|
| Default | `600` permissions applied recursively at startup and after migration restores. |
| Default | The selected managed provider's generated profile is removed. Other auth profiles receive `600` permissions recursively at startup and after migration restores. |
| What you can change | This is not a user-facing knob. The entrypoint enforces it. |
| Risk if relaxed | Looser permissions let other users or processes on the host read provider API keys and tokens stored in auth profiles. |
| Recommendation | No action needed. If you see a `permission denied` error when reading auth profiles, verify that you are running as the same user who created them. |
Expand Down
171 changes: 164 additions & 7 deletions scripts/nemoclaw-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ unset NEMOCLAW_ENTRYPOINT_NORMALIZED_ARGC NEMOCLAW_ENTRYPOINT_NORMALIZED_ARGV \
unset -f nemoclaw_normalize_entrypoint_env_wrapper
# managed-entrypoint-env-wrapper end

# OpenShell owns inference.local authentication. Clear its credential aliases
# after entrypoint overrides are normalized, before setup can launch children.
# Direct inference routes retain their credentials.
is_managed_inference_route() {
# Match URL scheme and host case without spawning a credential-bearing child.
[[ "${NEMOCLAW_INFERENCE_BASE_URL:-}" =~ ^[Hh][Tt][Tt][Pp][Ss]://[Ii][Nn][Ff][Ee][Rr][Ee][Nn][Cc][Ee]\.[Ll][Oo][Cc][Aa][Ll](:443)?(/.*)?$ ]]
}

clear_managed_inference_credentials() {
if is_managed_inference_route; then
unset NVIDIA_INFERENCE_API_KEY NVIDIA_API_KEY
fi
}
clear_managed_inference_credentials

# Reject an invalid explicit dashboard port before installing the tee/fd startup
# capture below. Some CI Docker runners can drop very early fd4 output from
# short-lived containers, and this validation is meant to be fail-fast and
Expand Down Expand Up @@ -2410,8 +2425,140 @@ prepare_gateway_token_for_current_command() {
fi
}

# Write an auth profile JSON for the NVIDIA API key so the gateway can authenticate.
# Reconcile this function's legacy generated auth profile for the selected provider.
# OpenShell authenticates managed inference.local routes on the host, so remove
# that generated credential reference. Preserve other user-managed profiles.
# Direct routes retain their existing profile-writing behavior.
write_auth_profile() {
local provider_key="${NEMOCLAW_INFERENCE_PROVIDER_ID:-${NEMOCLAW_PROVIDER_KEY:-inference}}"

if is_managed_inference_route; then
# Remove only the exact entries this function historically generated.
# Preserve user-managed direct-provider profiles if they share the file.
python3 - "$provider_key" <<'PYAUTH'
import json
import os
import secrets
import stat
import sys
provider_key = sys.argv[1]
managed_profile_id = f'{provider_key}:manual'
profile_name = 'auth-profiles.json'
openclaw_path = os.path.expanduser('~/.openclaw')
directory_flags = os.O_RDONLY | os.O_DIRECTORY | getattr(os, 'O_NOFOLLOW', 0)
def security_failure(detail):
print(f'[SECURITY] Refusing auth-profile cleanup: {detail}', file=sys.stderr)
raise SystemExit(1)
def open_profile_directory():
try:
directory_fd = os.open(openclaw_path, directory_flags)
except FileNotFoundError:
raise SystemExit(0)
except OSError:
security_failure('the .openclaw root is not a trusted directory')
for component in ('agents', 'main', 'agent'):
try:
child_fd = os.open(component, directory_flags, dir_fd=directory_fd)
except FileNotFoundError:
os.close(directory_fd)
raise SystemExit(0)
except OSError:
os.close(directory_fd)
security_failure(f'{component} is not a trusted directory')
os.close(directory_fd)
directory_fd = child_fd
return directory_fd
directory_fd = open_profile_directory()
try:
try:
profile_fd = os.open(
profile_name,
os.O_RDONLY | getattr(os, 'O_NOFOLLOW', 0) | getattr(os, 'O_NONBLOCK', 0),
dir_fd=directory_fd,
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
except FileNotFoundError:
raise SystemExit(0)
except OSError:
security_failure('auth-profiles.json is not a trusted regular file')
if not stat.S_ISREG(os.fstat(profile_fd).st_mode):
os.close(profile_fd)
security_failure('auth-profiles.json is not a regular file')
try:
with os.fdopen(profile_fd, encoding='utf-8') as profile_file:
profiles = json.load(profile_file)
except (OSError, UnicodeError, json.JSONDecodeError):
# Unknown or user-managed state is not ours to replace or delete.
raise SystemExit(0)
if not isinstance(profiles, dict):
raise SystemExit(0)
def is_legacy_managed_profile(profile_id, profile):
if profile_id != managed_profile_id or not isinstance(profile, dict):
return False
return profile == {
'type': 'api_key',
'provider': provider_key,
'keyRef': {'source': 'env', 'id': 'NVIDIA_INFERENCE_API_KEY'},
'profileId': managed_profile_id,
}
retained = {
profile_id: profile
for profile_id, profile in profiles.items()
if not is_legacy_managed_profile(profile_id, profile)
}
if retained == profiles:
raise SystemExit(0)
if not retained:
os.unlink(profile_name, dir_fd=directory_fd)
raise SystemExit(0)
temporary_name = f'.auth-profiles.{secrets.token_hex(16)}'
try:
temporary_fd = os.open(
temporary_name,
os.O_WRONLY | os.O_CREAT | os.O_EXCL | getattr(os, 'O_NOFOLLOW', 0),
mode=0o600,
dir_fd=directory_fd,
)
except OSError:
security_failure('could not create a private replacement file')
try:
with os.fdopen(temporary_fd, 'w', encoding='utf-8') as profile_file:
json.dump(retained, profile_file)
profile_file.flush()
os.fsync(profile_file.fileno())
os.replace(
temporary_name,
profile_name,
src_dir_fd=directory_fd,
dst_dir_fd=directory_fd,
)
except BaseException:
try:
os.close(temporary_fd)
except OSError:
pass
try:
os.unlink(temporary_name, dir_fd=directory_fd)
except FileNotFoundError:
pass
raise
finally:
os.close(directory_fd)
PYAUTH
return
fi

if [ -z "${NVIDIA_INFERENCE_API_KEY:-}" ] && [ -n "${NVIDIA_API_KEY:-}" ]; then
export NVIDIA_INFERENCE_API_KEY="$NVIDIA_API_KEY"
fi
Expand All @@ -2427,7 +2574,6 @@ write_auth_profile() {
# through v0.0.89 so pre-existing custom images keep routing. Remove this
# fallback in v0.0.90.
# See: https://github.com/NVIDIA/NemoClaw/issues/1332
local provider_key="${NEMOCLAW_INFERENCE_PROVIDER_ID:-${NEMOCLAW_PROVIDER_KEY:-inference}}"
python3 - "$provider_key" <<'PYAUTH'
import json
import os
Expand Down Expand Up @@ -4736,6 +4882,7 @@ setup_auth_profile_as_sandbox() {
run_step_down_as_sandbox \
"export HOME=/sandbox; write_auth_profile; harden_auth_profiles" \
openclaw_config_dir_owner \
is_managed_inference_route \
write_auth_profile \
harden_auth_profiles
}
Expand Down Expand Up @@ -5406,6 +5553,10 @@ if [ "$(id -u)" -ne 0 ]; then
# Apply manifest-declared runtime env aliases before any child inherits the
# env. This covers both one-shot commands and the gateway launch.
apply_messaging_runtime_env_aliases
if is_managed_inference_route; then
write_auth_profile
harden_auth_profiles
fi

if [ ${#NEMOCLAW_CMD[@]} -gt 0 ]; then
install_messaging_runtime_preloads
Expand Down Expand Up @@ -5444,7 +5595,9 @@ if [ "$(id -u)" -ne 0 ]; then
fix_openclaw_ownership
normalize_mutable_config_perms
seed_default_workspace_templates /sandbox/.openclaw/workspace "" /sandbox/.openclaw/openclaw.json
write_auth_profile
if ! is_managed_inference_route; then
write_auth_profile
fi
harden_auth_profiles

prepare_auto_pair_log
Expand Down Expand Up @@ -5496,6 +5649,10 @@ apply_model_override
reconcile_agent_model_with_provider
apply_cors_override
configure_messaging_channels
# Remove the obsolete managed reference before Doctor can import it into SQLite.
if is_managed_inference_route; then
setup_auth_profile_as_sandbox
fi
run_requested_openclaw_post_upgrade_doctor || exit 1
refresh_openclaw_provider_placeholders
ensure_mutable_openclaw_config_hash
Expand All @@ -5518,10 +5675,10 @@ apply_messaging_runtime_env_aliases
install_messaging_runtime_preloads
verify_messaging_runtime_secret_scans

# Write auth profile as sandbox user and recursively re-tighten any
# auth-profiles.json files under ~/.openclaw. See
# setup_auth_profile_as_sandbox for the HOME-handling rationale.
setup_auth_profile_as_sandbox
# Write direct-route profiles after Doctor has migrated existing user profiles.
if ! is_managed_inference_route; then
setup_auth_profile_as_sandbox
fi

# If a command was passed (e.g., "openclaw agent ..."), run it as sandbox user
if [ ${#NEMOCLAW_CMD[@]} -gt 0 ]; then
Expand Down
Loading
Loading