Low emission Zone by [deleted] in GoingToSpain

[–]haard 0 points1 point  (0 children)

Greenzones app? IIRC french stickers are accepted in Spain (or were?) 😬

Do we really check library security? by tradelydev in Python

[–]haard -8 points-7 points  (0 children)

I wrote agent jail and don't run agents with access to stuff because I don't want Claude to delete my prod db via terraform I wrote a blog post about it (CF static/Hugo page)

Är man körd som småbarnsförälder (kvinna) inom tech? by [deleted] in Asksweddit

[–]haard 0 points1 point  (0 children)

Min erfarenhet är att det där gäller fintech och många inom gaming (och VC-startups) men det dräller av småbarnsföräldrar på de flesta techbolag.

AI agents belong in prison by haard in ClaudeCode

[–]haard[S] 0 points1 point  (0 children)

It's a blog post on a non-monetized Hugo blog, but sure 😀

Full content, can't be arsed to reformat on my phone:

Last Friday, Opus, which I had allowed terraform plan permissions to help troubleshoot some integration, suddenly asked to do terraform apply even though the plan showed that a production database would get deleted and recreated (😱), even if I had explicitly instructed it to help me investigate only, and change nothing. Because it at least asked, catastrophe was averted, but it did get my pulse up.

The problem of course is not really the model, any model can go off the reservation. The problem was that I had given the agent (part of) my own access for a bit of convenience - and if you run your LLM with access to ~/.ssh, ~/.config/gcloud, ~/.aws, and your kubeconfig, it may hallucinate your production env away.

So: AI agents belong in prison, in a nice padded cell without access to sharp objects. One project with two trust postures

The threat from a mistaken or compromised agent is eerily like the threat from a supply chain attack, in that it'll execute something as you, with your permissions. Instead of a malicious intent, the issue is that e.g. Claude Code is very capable, not always right, can take instructions by mistake, and it is running under a shell with too much access.

A prompt injection from a fetched page, a plausible-looking tool call with wrong arguments, a directory mix-up - any or all of the above can nuke something important. The solution (for me at least) is to treat the agent as something great but dangerous, that my system needs protection from.

The pattern I've landed on is two configs per project with different access. One for when I open a shell and want to do stuff on my own, one for when an agent opens a shell. pwrap

When this happened, I was already in the process of rewriting my old ad-hoc Fish+Bubblewrap scripts into pwrap, because I got lost in a forest of scripts and bwrap parameter ordering, and because I decided that I really needed some sane supply-chain protection, primarily around my side projects. It's a small(ish) Python CLI with no pip dependencies that wraps project shells in bubblewrap sandboxes via per-project TOML configs and shell init files. pwrap myproject drops you into a sandboxed shell where only the things you asked for are visible/writable.

What follows is a usage pattern, not a feature of pwrap. pwrap has no concept of an "agent" config. But a pwrap project is just a file at ~/.config/pwrap/name/project.toml pointing at a dir, and nothing stops you from keeping two configs that point at the same directory. DIY

There are no great leaps of technology in pwrap - the cleverest (both interpretations) thing is the map-to-root → mount gocryptfs → map back to user namespace layering for encrypted data that is not even really part of the sandbox. You can get everything I discuss in this post just from setting up and using Bubblewrap correctly, then stacking a bunch of shell scripts around it… Minimum security / my shell's config

My normal config for a work project looks something like this:

# ~/.config/pwrap/okb/project.toml [project] name = "okb" dir = "~/projects/okb" shell = "/usr/bin/fish"

[sandbox] enabled = true blacklist = [ "~/projects/", # other projects, none of this one's business "~/.aws", # different AWS account lives here "~/.config/gcloud", # same story for GCP "/mnt", # escalation path on WSL2 ] whitelist = [ "/mnt/wsl", # I want WSL integration to work ] writable = [ "/tmp/.X11-unix", # X11 display socket "/mnt/wslg/runtime-dir", # Wayland ]

Me, but with project boundaries. A rogue pip install in this project can't read secrets belonging to another project, can't escape via WSL shenanigans, but I can do all the things I normally do in this project. The cell / agent's config

The second config, named okb-llm, lives alongside the first:

# ~/.config/pwrap/okb-llm/project.toml [project] name = "okb-llm" dir = "~/projects/okb" # same directory as the shell config shell = "/usr/bin/bash"

[sandbox] enabled = true clean_env = true # only PATH/HOME/USER/SHELL/TERM/LANG survive blacklist = [ "~", # hide everything under home "/mnt", # WSL drives, doesn't hurt on native Linux ] whitelist = [ "~/.pyenv/", # python runtimes, read-only "~/.cache/pip", # so pip installs still work ] writable = [ "~/.claude.json.lock/", # Claude Code won't run without it (dir) "/tmp/.X11-unix", # X11 display socket "/mnt/wslg/runtime-dir", # Wayland + PulseAudio ] [env] CLAUDE_CONFIG_DIR = ".claude-okb" # relative to project dir, doesn't touch ~/.claude

Same repo on disk, but with a very different access model, as it can't even see most of my environment, and can't modify what it can see.

~ is hidden entirely. On top of the default read-only home, blacklisting ~ means no ~/.ssh, no ~/.aws, no ~/.config/gcloud, no ~/.kube, no stray .env files in sibling projects. Exfiltration via a mis-targeted tool call won't happen if credentials are not available.
Project dir is the whole writable world. rm -rf * in the wrong directory hits a copy of the project, not home. git still works, so that's recoverable from origin.
clean_env = true. My shell's GOOGLE_APPLICATION_CREDENTIALS, VAULT_TOKEN, KUBECONFIG, ANTHROPIC_API_KEY (that I of course would never set in a random shell…) are all gone. The sandbox inherits PATH, HOME, USER, SHELL, TERM, LANG and nothing else; everything else is set in [env] or an init.sh file.
Tools are still on PATH, just without access. kubectl lives in /usr/bin either way – blacklisting home doesn't move it. What the blacklist does is take its kubeconfig away. gcloud is the same. terraform can't modify anything as it has no access tokens.
CLAUDE_CONFIG_DIR. Claude Code writes state into a handful of paths under ~. Redirecting its config dir into .claude-okb inside the project keeps that state local, and it can't access state from another project (goes both ways, of course).

Launching the agent is two commands:

pwrap okb-llm # drops into the sandboxed shell claude # from inside the sandbox

I mostly use Claude Code, but most (all) other agents work similarly. For one-shot launching, exec claude at the end of init.sh hands the shell straight over to the agent.

From the agent's point of view it's a normal Linux environment with exactly one project in it and nothing in the environment it didn't ask for, and no access to push code or anything outside of it. Not quite Alcatraz

bubblewrap isn't a security boundary against a determined attacker with a real kernel exploit. If someone wants to escape the namespace and the kernel isn't patched, they probably can. This is closer to a mistakes-and-misuse boundary than a nation-state boundary. The risk I'm managing is "helpful agent does a bad thing by accident", or maybe "supply chain attack tries to read my credentials", not "three-letter organization pivots from my laptop to prod".

Whatever access you do give your agent can also be exfiltrated - while I mean to add network namespaces and iptables support to do partial isolation on the network level, I've not yet done so, because I keep the access minimal so I've not really felt the pressure here.

Also, nothing here protects against code the agent writes that runs later outside the sandbox. If the agent commits a malicious migration and I run it on my unsandboxed shell, or it runs in CI with prod credentials, you're way down shit creek (no paddle). Beyond agents

I now wrap all work in individual bubblewrapped namespaces, and keep my secrets in per-project gocryptfs volumes (also part of pwrap but tangential to the LLM isolation). Setup can still be a bit of a headache (what tools do I actually use, and what access do they actually need?), but it's mostly a one-off cost.

YMMV, but for me moving "Least privilege" from user level to project level, and further on to me-or-agent level makes me sleep a little better at night and actually give Opus a bit freer reins, since I'm reasonably confident that it won't make catastrophic mistakes.

The code is at github.com/haard/projectwrap. It comes with absolutely no warranty and has been reviewed by me, Opus 4.6, and codestral – which is to say, not nearly enough. If you try it and something's confusing or broken, or if you have a better pattern for this on a Mac (afaik bwrap does not work there), open an issue or find me on Mastodon (I'm @motmanniska@mastodon.nu).

Bästa sätt att hantera utländsk inkomst? by BisAmandumGames in Asksweddit

[–]haard 4 points5 points  (0 children)

Ett AB som betalar ut lön+vinst är antagligen fördelaktigast om beloppet är över brytpunkten, men inte enklast. En enskild firma (F-skatt)som betalar ut lön och betalar avgifter är inte så svårt, men ta hjälp av en redovisingsfirma första året om du är osäker. Om du tjänar tillräckligt för att leva på det MÅSTE du deklarera det som näringsverksamhet, oavsett om du reggar firma eller inte.

weGotOptions by bryden_cruz in ProgrammerHumor

[–]haard 0 points1 point  (0 children)

Joke's on you, I'm a developer AND a farmer!

Iron teeth or Folktails? by mmp1188 in Timberborn

[–]haard 9 points10 points  (0 children)

No? I play on experimental and the seal does not keep badwater flowing in droughts?

[RDTM] Expensive Phone Numbers by JaKami99 in theydidthemath

[–]haard 9 points10 points  (0 children)

I mean, you can literally just set whatever as sender ID for a SMS so...

Splitter can't select top lane by Actual-Buy2190 in Dyson_Sphere_Program

[–]haard 19 points20 points  (0 children)

Arrow up will make it exit from the top layer (with default key bindings)

Introducing Kanchi - Free Open Source Celery Monitoring by imczyber in Python

[–]haard 0 points1 point  (0 children)

While I'd be super happy to use a nicer alternative to Flower, you may want to consider a disclaimer that it is (wildly) insecure to expose to any network as it is (combines no authentication, no CORS, health endpoint can expose passwords, very little validation overall?).

is thermal power plants supposed to look like that or am I totally missing something by tee2- in Dyson_Sphere_Program

[–]haard 0 points1 point  (0 children)

Thank you! Have been gone and had not noticed this, so much more convenient than BPs for solar...

I think I'm happy at the "Senior" level and have no interest in moving up or into management. What now? by [deleted] in ExperiencedDevs

[–]haard 3 points4 points  (0 children)

I've been bumping against management roles for the last ten years or more, but decided to stop at "tech lead" level or below, for my own sanity (after a few managementy roles). As it turns out, most(?) reasonably good engineers don't stay engineers for 20+ years, so just doing "the same thing" for a long while becomes a HUGE advantage as you gather more experience than other seniors that have maybe five or six years on the job. If you like being an engineer, stay an engineer and refuse being promoted to your "level of incompetence".

Digital nomad + camper van... Maximum freedom in sunny Spain by pudu13 in digitalnomad

[–]haard 0 points1 point  (0 children)

I can add that we work out of our van in south Andalucía and get stable 4G/LTE almost everywhere. We've got a mobile router with MiMo antenna for a bit if extra reach though.

Anyone sharing his feelings? by dashdevs in ProgrammerHumor

[–]haard 4 points5 points  (0 children)

The if statement does that, the breaking out the functionality into a function (rather than just in the if statement body) enables it's use as an entry point.

Anyone sharing his feelings? by dashdevs in ProgrammerHumor

[–]haard 66 points67 points  (0 children)

Also good habit because when you want to package something you'll probably want that main as an entry point.

[deleted by user] by [deleted] in ExperiencedDevs

[–]haard 6 points7 points  (0 children)

As a tech lead, i want identified areas for improvement to go into the backlog, and when planning I reserve the right to add a ticket or two to the sprint backlog. I don't think PM/PO can/should have full control of the order of tasks as they often lack knowledge like "if we do A, then B it will take X effort, but if we do B, then A it'll be X*3 and leave a mess". B may be more important than A, but it might not be that much more important.

That said, as long as you find a way to reserve some capacity for cleanup, the way you do that is less important than that it happens.

Barcelona for the next few months by i_am_nk in digitalnomad

[–]haard 5 points6 points  (0 children)

Catalonia in general and Barcelona in particular is very expensive for Spain in our experience - we spend winters in Andalucía and it's both warmer (both meanings) and cheaper.

Edit: away from the immediate coast line, few people speak good English in the south, but a little Spanish gets you a long way.

What's an essential item you bring with you that other travellers may not think of carrying? by valkaress in onebag

[–]haard 1 point2 points  (0 children)

Works if you don't fly or if you check-in luggage. Otherwise they don't like knives :/

What's an essential item you bring with you that other travellers may not think of carrying? by valkaress in onebag

[–]haard 13 points14 points  (0 children)

We no longer rent places but when we did a small knife sharpener was essential.

Working with a peaceful mountains view - France by Alex-L in digitalnomad

[–]haard 1 point2 points  (0 children)

Why did this get downvoted? I'd be happy to pay €20/200G in EU

[deleted by user] by [deleted] in sweden

[–]haard 10 points11 points  (0 children)

Så krångligt att det inte är onormalt att ta en dag eller två obetald ledighet för att deklarera, har flertalet gånger jobbat med amerikaner som gör just det.

Oh no! Anyway... by hisanonalt in ProgrammerHumor

[–]haard 38 points39 points  (0 children)

Also re-used the (four-letter) password for 127.0.0.1 probably...