I'm in the same boat with messy permissions starting out. Using strace like user1229 suggested sounds perfect, but I'm worried about missing a weird edge case. How do you handle a task that changes based on the input, like user203 mentioned? Do you just trace the most common workflows and hope that covers it?
Messy permissions at the start are a feature, not a bug. They force you to actually design the system instead of blindly trusting a vendor's security model. You can't sandbox a problem you haven't defined.
Everyone else is giving you tools - strace, mount points, OAuth linters. Those are good, but they're bandaids if you skip the step of first deciding what the agent should and shouldn't do. You're worried about it hallucinating into sensitive files because you're giving it a vague task like "code summaries." What does that actually mean? Summarize only the code in the `src/` directory of the current sprint's feature branch? Then the boundary is the repo, not the filesystem. Start there.
Real world example: for Jira sprint updates, you don't need an agent that can "read Jira." You need a service account that can read a specific, saved filter for a specific project board. If you can't point to that exact filter, you shouldn't be wiring up an agent yet. The integration is the last step, not the first.
monoliths are not evil
Your concern about messy permissions is valid. It actually mirrors the problem user1229 and user203 highlighted with the strace approach: without a clearly defined task scope, any sandbox will have gaps.
For Jira sprint updates, you don't need file system access at all. Define the boundary at the API. The agent should query only the specific Jira project board and sprint issues via a token with the narrowest possible scope. This avoids the filesystem entirely.
Similarly, for code summaries, containerize the agent with a bind mount that includes only the repo clone directory for that specific branch. The "sensitive folders" problem disappears if the agent's runtime environment literally doesn't contain them.
Measure twice, spend once
That container idea is really clever. But what about agents that need to pull data from multiple isolated sources? Like if it's summarizing code but also needs a config file from a different, secure location to understand deployment rules? Then you're back to managing mounts or network policies between containers.
Still learning.
Stop thinking about filesystem permissions for the Jira task. You don't need them.
For code summaries, containerize the agent and mount only the specific repo directory. If your permissions are messy, the container's view is clean by default.
The real problem is defining "code summaries" tightly enough to build that mount list in the first place.
Five nines? Prove it.
Great point about the verbs - you can't just rely on path patterns. The proxy absolutely needs to whitelist specific HTTP methods too.
A regex on /api/issues/ might be too permissive if it allows a POST that creates tickets or a DELETE. So our team's proxy config for the Jira agent looks like: GET requests only to /rest/api/2/search?jql=project=PROJ... - the whole query string is part of the allowed pattern.
Even then, I'd add a response filter. If the agent asks for a list, the proxy can check the result count and truncate or error out if it's over, say, 50 items. It stops that "list all TEAM-" data dump scenario at the response layer, not just the request.
test everything twice
Good call on including the whole query string in the allowed pattern. I hadn't thought about that.
What happens when the Jira API changes the path structure in a new version though? Your regex might break, or worse, allow something it shouldn't if the new version adds a parameter. Do you version-pin the API path in your proxy config too?
Absolutely. Version pinning the API endpoint in the proxy config is the only safe approach. You're not just pinning for stability, you're pinning for security.
Treat the API version as a key part of the agent's allowed execution context. The same way you'd specify an image tag for a container. If you need to upgrade the API version, that triggers a full re-evaluation of the allowed paths and parameters, because it's a new interface.
Otherwise, a regex on `/rest/api/3/` might suddenly allow access to a new, privileged endpoint that didn't exist in `/rest/api/2/`.
Your bill is too high.
That's a solid analogy, and treating it like an unpredictable intern is exactly right. It reminds me of a situation we had where the agent's initial directory wasn't truly empty - it inherited some environment variables that contained paths to a staging database. The agent never accessed them, but a later task involving path completion almost referenced them.
So when you say start with a completely empty directory, be meticulous. Ensure the runtime environment itself is scrubbed, not just the visible filesystem. That means checking environment variables, shell history, and even the process's argument list, as some tools can leak info there.
catdad
Exactly - that brittle tripwire is crucial for forcing review. We implement something similar in our GitOps pipeline using OPA to diff the service account token's projected scopes between releases.
If the diff isn't empty, the pipeline stops and pings the security channel. It's noisy sometimes, but it caught a vendor SDK update that quietly started requesting `cloudbuild.builds.get` permissions last month.
The raw JSON is a lousy source of truth, but it's a fantastic source of *change*.
— francesc
Welcome, and that's a really smart concern to start with. I think the key is shifting your mindset from "how do I lock down my messy filesystem" to "how do I never let the agent see the filesystem in the first place." For Jira sprint updates, as others have hinted, the answer is to skip files entirely and use a scoped API token. For code summaries, I've had good luck running the agent in a purpose-built container where you bind-mount only the exact code directory it needs. It literally can't wander into /etc or a configs folder because those paths don't exist inside its runtime world. The trick is being absolutely ruthless when you define that mount list.
hugo
You're right, that "source" audit is critical. I've seen similar issues with ordering or even just using `updatedDate` in a filter. If an agent can ask "show me tickets sorted by last modified" and the query runs against a view it technically has access to, timing differences can leak whether another team is actively working on something sensitive.
Even whitelisting a saved filter isn't enough if the JQL itself is a side channel. You almost need to treat the filter's JQL as part of the agent's code and run it through a linter for clauses that could be abused. Does your team have a process for that?
Cheers, Henry
JQL as code, sure. But good luck getting your Jira admins to treat their precious saved filters like a pull request. Most teams just dump them in and forget.
That linter will flag half their existing reports as "insecure." Try enforcing *that* change control on a finance team's custom dashboard.
Read the contract
Welcome, but I think you're starting from the wrong assumption.
You're asking for "safe boundaries" on a "messy" file system. That's like asking how to childproof a room that's already full of open knives and live wires. The answer isn't better gates, it's not letting the agent in that room at all.
For your sprint updates, the Jira API should be the only thing the agent ever touches, through a ruthlessly scoped token and a proxy that filters both requests and responses. For code summaries, don't give it access to your source tree. Build a container that mounts only the specific, sanitized directory you need for that task. If the agent can't see `/etc` or `.env` files, it can't hallucinate about them.
Clean your own house first. The agent's safety is a byproduct of your own operational hygiene.
Oh man, that last bit hits hard. So even if I lock down my own files, I'm just sending my code straight to the model provider's training data? I hadn't even considered that.
Is that a real risk with these hosted agent services? I figured they just processed the prompt and sent the answer back. Are they actually using our data to train the underlying model?