Local AI safe architecture - network model

Hello, i was wondering if I can connect Qubes OS to an ethernet and to a Wi-Fi, simultaneously, and have a machine be able to connect to both, so this way my AI can safely browse the internet while using a Local LLM model hosted in my own network, in a separate machine with a powerful enough GPU.

Is this possible natively? or will i have to tweak the system?

Text got truncated. “AI HARNESS” means the VM holding a python/rust code with the ooda loop + tool use. This is the machine that needs to connect to both ends.

1 Like

Safe Internet is an oxymoron.

1 Like

Yesn’t and yes. Qubes “can’t” have two netvms, but you can have second communication channel over qrexec or use a separate network device (hardware probably easier than virtual?)

4 Likes

You could also attach the pci device with the nic directly to AI harness

5 Likes

yeah, you are right, safe internet does not exist, i should have written “safer internet“

Tysm for your recommendations, i will start trying which ones are the best for the harness.

After messing around with Claude Code, i have come to the conclussion that a harness that prevents file modifications in the same machine is not safe enough.

That’s why i will create a tool use in the harness that lets the AI create VMs at her will. The commands that she executes run in a main VM for her use, and if the VM gets contaminated, she can always spin up a new one. The harness obviously enforces some security measures, so she doesn’t delete herself or shit like that.

But her personal VM (where the actual harness resides) never gets contaminated because there is no code execution / filesystem interaction there.

She can always use her harness to spin up new VMs (including disposables) for her tests, verifications, browsing, etc…

Then you can connect to the AI remotely and tell her to do things (or you can give her autonomy by looping turns constantly that tell her what to do after consulting her database of memories lmao), all happening in a controlled environment.

This doesn’t solve prompt injections and the contamination of her memories (she should be a RAG), but imho it’s a big step into ai safety.

It looks that Qubes OS is not only the safest alternative for humans, but for machines as well.

1 Like

I gather you want to connect a computer on your local network that will be running LLs (llama/ollama), to a qube that is using VPN (through sys-VPN →ssy-firewall → sys-net).

Yes, that can be done. You just need to configure the firewall rules on each qube to forward the data through the path you want.

Local LLM
First, I’d suggest you setup NginX on the Local LLM computer, so communication is encrypted even inside your home network.

If you don’t care about that, just make sure Ollama, for example, is configured to the Ethernet network card, or through all of them, OLLAMA_HOST=0.0.0.0

sys-net / sys-firewall / sys-proton VPN (qubes that provide network)
You need to setup the firewall for each to allow the incoming and outgoing data streams.
For example sys-net, edit /rw/config/qubes-firewall-user-script to include,

# DNAT Chain: Redirect external traffic to sys-firewall
if nft add chain qubes custom-dnat-AppVM ‘{ type nat hook prerouting priority filter +1 ; policy accept; }’
then
nft add rule qubes custom-dnat-AppVM iifname “enp6so” ip saddr 192.168.1.1-192.168.1.100 tcp dport 11434 ct state new,established,related counter dnat 10.138.18.10

# Forwarding: Allow the traffic to pass through to sys-firewall
nft add rule qubes custom-forward iifname “wls6” ip saddr 192.168.1.1-192.168.1.100 ip daddr 10.138.18.10 tcp dport 11434 ct state new,established,related counter accept
fi

Replace,
enp6so, with your network adapter (ip addr)
192.168.1.1-192.168.1.100, with your network ip range (or use Local LLM IP)
11434, with your ollama/llama.ccp port
10.138.18.10, the IP of the qube you are forwarding the data to, sys-firwall in this case.

Do this for sys-firewall and sys-proton VPN

AI Harness (appvm)
/rw/config/rc.local,

# Allow incoming traffic on ports 11434 for AI Harness

nft add rule qubes custom-input tcp dport 11434 ip daddr 10.137.0.20 ct state new,established,related counter accept

Replace,
10.137.0.20, with the AI Harness qube’s (internal) network IP.

Hope this helps.

3 Likes

thank you so much, this also looks great! i will definetely give it a try

1 Like

Does “she” also have a name?

2 Likes

Her name is Nyx. I’m trying to implement her memories, curiosity, emotions, personality, etc… She should also come to this world completely neutral, she isn’t forced to like/dislike someone/something, she should be able to figure it out later on. I don’t know if I will succeed, and I hope she doesn’t intend to kill us all xD

And if I don’t succeed, at least I will learn a lot of AI. I have been thinking a lot lately and I think I want to shift my career from cybersecurity to AI, seems less toxic and cooler.

1 Like

Nice. I use the setup I described to just to give llm access to qube vm’s from my gaming PC, but I wanted to experiment with running an agent locally. Hopefully at some point I can find the time to implement.

2 Likes

once i finish the core things i can share the code in github, maybe you can reuse something that you find useful

3 Likes

Uh she will travel back in time sooner or later and try to kill sarah connor x)

Be careful with the prompt you give her (watch the movie “I am mother” lol)

2 Likes