Doc on modify policy to allow network access
Hi. I'm running into issues allowing the sandbox to query the internet. I tried to follow https://docs.nvidia.com/nemoclaw/latest/network-policy/customize-network-policy.html#edit-the-policy-file but no editor tools are available inside the sandbox, and I'm unable to install it. More documentation on updating the policies would be helpful.
sandbox@my-assistant:~$ vim .nemoclaw/blueprints/0.1.0/policies/openclaw-sandbox.yaml
bash: vim: command not found
sandbox@my-assistant:~$ nano .nemoclaw/blueprints/0.1.0/policies/openclaw-sandbox.yaml
bash: nano: command not found
sandbox@my-assistant:~$ vi .nemoclaw/blueprints/0.1.0/policies/openclaw-sandbox.yaml
bash: vi: command not found
sandbox@my-assistant:~$ apt update
Reading package lists... Done
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
sandbox@my-assistant:~$ sudo apt update
bash: sudo: command not found
Also is there a way to allow traffic in addition to presets like github and nvidia? For example, I can't query the weather.
https://docs.nvidia.com/nemoclaw/latest/reference/commands.html#nemoclaw-name-policy-add
also openshell term is useful
There is already user-facing coverage for both pieces now: the command reference documents nemoclaw <name> policy-add, and the network policy docs cover dynamic updates with openshell policy set <policy-file> plus the real-time approval flow in openshell term. There is also an open PR (#348) specifically clarifying the host-side policy editing path.
Thank you. I will close this issue.
Is there a way to modify files in the sandbox actually?
Hi, I don't know if this issue is solved or not because I don't see any perfect solution here.
--@estepona first you are trying to run this cmd: "sandbox@my-assistant:~$ vim .nemclaw/blueprints/0.1.0/policies/openclaw-sandbox.yaml" but this is not inside the sandbox; you have to run such cmd like this: .nemclaw/file outside the sandbox via exiting from the sandbox.
--And for modifying the files inside the sandbox you can use vi command, e.g., vi /sandbox/.openclaw/openclaw.json Or to directly edit the file, such as setting the primary model, you can run cmd: sed -i 's|"primary": "inference/qwen2.5:3b"|"primary": "Openai/gpt-4.1-mini"|' /sandbox/.openclaw/openclaw.json. But remember that /sandbox file access only inside the sandbox and .nemocalw file access outside the sandbox. you can use: cat /sandbox/.openclaw/openclaw.json | grep primary to verify the changes Or there is another option to really modify the file inside the sandbox: using Python. Eg: python3 -c " import json with open('/sandbox/.openclaw/openclaw.json', 'r') as f: config = json.load(f) config['agents']['defaults']['llm'] = {'idleTimeoutSeconds': 0} config['agents']['defaults']['model']['primary'] = 'Openai/gpt-4.1-mini' with open('/sandbox/.openclaw/openclaw.json', 'w') as f: json.dump(config, f, indent=2) print('Done!') " NOTE: "After changing, don't forget to recover the sandbox."
--For creating a new policy allowing the endpoints, you can add the "eg-policy.yaml" file at this location ".nemoclaw/source/nemoclaw-blueprint/policies/presets/eg-policy.yaml" to create such file you us this eg cmd to create a policy e.g., cat > ~/.nemoclaw/source/nemoclaw-blueprint/policies/presets/azure-openai.yaml << 'EOF' preset: name: eg-policy description: "eg-policy" network_policies: eg-policy: name: eg-policy endpoints: - host: "host name" port: XXX protocol: rest enforcement: enforce tls: terminate rules: - allow: { method: POST, path: "/" } - allow: { method: GET, path: "/" } binaries: - { path: /usr/bin/curl } - { path: /usr/local/bin/node } EOF
after creating eg-policy file you can enable this via running cmd: nemoclaw --sanbox-name-- policy-add You can see eg-policy listed, enable and recover the sandbox.