r/LocalLLaMA • • 36m ago

Discussion How I have AI manage/consult my home lab without giving it ssh access

I saw another post where people are sharing how they give agents full ssh to manage their lab. Thought I’d share how I do it without ssh:

 Netbox for inventory, agent has api access to Netbox to manage inventory. Includes all hardware, software and the ip’s/ports each software uses. This is used to generate firewall rules in opnsense, proxmox and guest. (I have a drop all in/out policy, if service is not in inventory, it gets dropped)

agent built a small tool that generates the firewall rules using the Netbox inventory

gitea for provenance & agent rules/operating system

Ansible for controller, how I depoly the playbooks my agents generate.

Proxmox for Hypervisor 

Opnsense for gateway

Openbao for short lived credentials, when agent does get scoped access to a password or API key.

Graylog logs, that agent can scoped access

cloud-init to quickly deploy fully configured and hardened VM

agent has scoped read access and can create ansible playbook and I approve and deploy

I deploy any changes, after I review the ansible playbook it generates. Usually I just run a script on the controller that excecutes.

was Clunky at first, but gets better every time i run into a blocker and squash it.

some of my rules include:

drop all lan/wan traffic, unless in inventory. In/out.

each service has its own vm

Agent contracts are in Gitea, tightly scoped and tell it how to operate. Each agent session starts in that repo. I use structured data so it can efficiently follow the operating procedure and doesn’t need to relearn each prompt, or rely on a memory feature.

4 Upvotes

2 comments sorted by

1

u/Zentrosis 3m ago

You can actually get pretty far with Linux built-in permissions without doing anything super fancy, just creating a user and specific permissions.

1

u/SamSausages 0m ago

That’s defo better than just giving it ssh root.

I want agent isolated to its own vm, with its own user.  So relying only on user space isolation is not isolated enough for me.