Repository navigation
AgentTrace: How should cross-platform file-access monitoring work? #3
Replies: 1 comment 6 replies
|
I'd share an event format, not a claim that all three OSes provide the same coverage. Keep the current workspace-change mode useful, but make process-attributed access a separate capability. The backend choices I'd investigate are:
I'd normalize the operation, native source, process identity, file identity/path and outcome only as far as the event supports them. Keep an authorization request, an observed open, and a completed read distinct. Put permissions, scope, dropped-event counts and known blind spots on the collector/session record. No event should mean "not observed under this coverage", not "the file wasn't accessed". For attribution, PID alone isn't enough. Keep PID plus start time/native generation and process-tree history at event time. Current snapshots can misattribute after PID reuse or reparenting. And an agent-root process isn't necessarily an AI conversation: multiple sessions can share a process, while a shared MCP daemon may sit outside its tree. Explicit session correlation is stronger; otherwise label the relationship as inferred or unknown. For prior art, osquery's FIM docs show separate backends and tables per OS. I'd study that separation, not treat every file-events table as process-attributed reads. Its FIM can also hash file contents, which is a different privacy choice from your metadata-only goal. Before expanding coverage, I'd run the same small conformance program against each backend: open without reading, ordinary read, mmap, a short-lived child, two agents sharing a directory, rename, and collector permission/loss failures. Report the actual observations per backend. Paths can be sensitive too, even with no contents captured. That seems a practical v1: honest changes-only fallback, optional native collectors, and attribution that can say "unknown". I haven't implemented or tested those collectors; this is based on the platform APIs and your README. |
Uh oh!
There was an error while loading. Please reload this page.
I'm working on AgentTrace, a local-first tool for observing what AI coding agents are actually doing on a developer's machine.
The current focus is process-level visibility: identifying active agents, separating multiple instances, tracking process trees, observing commands, and optionally watching workspace changes.
The next part I want to tackle is file-access monitoring.
And this is where I have deliberately stopped implementation.
The problem
I don't just want AgentTrace to tell me:
I want to eventually be able to answer questions such as:
This matters particularly for sensitive files.
For example, if an AI coding agent modifies an
.envfile, I don't want AgentTrace to simply infer:I want to distinguish between:
Observed:
Observed:
Derived:
And leave anything about intent to interpretation rather than presenting it as fact.
Where I've hit the wall
The problem is that filesystem monitoring is not equivalent to filesystem change watching.
A normal directory/file watcher can tell me about changes, but it doesn't necessarily tell me which process caused or accessed the file.
Then the platform problem appears.
Different operating systems expose different mechanisms and different levels of access.
Linux, Windows and macOS do not give me one portable API that I can simply wrap and call this feature "cross-platform."
There are approaches involving things such as:
But these introduce different requirements, permissions, coverage, installation models, and maintenance costs.
That creates a product question rather than simply an implementation question.
What I don't want to do
I don't want to implement a Linux-specific solution, add a thin abstraction around it, and then call AgentTrace "cross-platform."
I also don't want to build a collection of weak file watchers that can only tell users when something changed while implying that AgentTrace knows which process accessed it.
And I don't want AgentTrace capturing file contents just to make the monitoring easier.
The intended direction is:
with paths and operation metadata rather than file contents by default.
The question
For people with experience in operating systems, filesystem monitoring, endpoint security, developer tooling, or cross-platform systems software:
What is the most practical architecture for building process-attributed file-access monitoring across Windows, macOS, and Linux while being honest about platform-specific limitations?
More specifically:
I'm especially interested in practical cross-platform approaches, not necessarily a perfect solution.
I'd rather pause here, understand the ecosystem, and build something technically honest than ship a platform-specific implementation simply because I wanted to check the feature off the roadmap.
If you've worked on this problem before, I'd genuinely appreciate your perspective.
AgentTrace: a local-first flight recorder for AI coding-agent activity.
I'm building this in the open, so I'm particularly interested in hearing from people who have opinions about the architecture—even if you think my current direction is wrong.
All reactions