Skip to content

identity: every event says operator_id "local", so the trail cannot say who ran the agent #168

Closed

Description

@blitzcrieg1

Every event this project has ever written says the same thing about who ran the agent.

core/audit/run_context.py:16:

def _operator_id() -> str:
    return settings.operator_id.strip() or "local"

AGENTMETRY_OPERATOR_ID is unset on a default install, so actor.id and
initiator.operator_id are the literal string local on every machine, in
every session, forever. The schema doc lists actor.id as PLAIN precisely
because it is supposed to identify somebody.

Why this matters more than a missing field

The strongest claim this project makes is that the trail is evidence: hash
chained, Merkle provable, externally anchorable. All of that proves a record was
not altered. None of it proves who the record is about.

An evidence pack that survives every integrity check and answers "who did this"
with local is not evidence of anything a dispute needs. The integrity work is
the expensive half and it is already done; the attribution half is one stdlib
call and is not.

It also silently breaks the two things built on top of it. Fleet deployment
cannot attribute an event to a laptop. And scripts/agentmetry_identity_enrich.py,
merged in #167, classifies personal versus work identity by reading actor.id,
which means on a default install it reads local, finds no address, and
correctly reports NO_EMAIL_FOUND for the entire estate.

What to do

Resolve the OS identity when nothing is configured, instead of falling back to
a constant:

  • getpass.getuser() as the baseline on every platform.
  • On Windows, prefer the domain-qualified name when there is one, so
    CORP\jdoe records as CORP\jdoe rather than jdoe. os.environ carries
    USERDOMAIN and USERNAME, and neither needs a new dependency.
  • Keep AGENTMETRY_OPERATOR_ID as an override, since a service account
    install wants to say so explicitly.
  • Record which source won, so an operator can tell a configured identity from
    an inferred one. The project already distinguishes covered from absent from
    unknown for hook coverage, and this is the same distinction.

What NOT to do

A proposal that reached me suggested reading Claude's auth cache to extract the
account email, organisation id and subscription tier. ~/.claude/.credentials.json
does exist on this machine, so it is possible.

I do not think this project should do it.

  • Reading another vendor's credential store is the single hardest thing to
    defend to the buyer whose first question is "what else does this read". The
    privacy design is the reason anyone installs this, and spending it here buys
    one field.
  • The format is undocumented and unversioned. It will change without notice and
    fail silently, which is the exact defect class this repo keeps finding in
    itself.
  • It is unnecessary. The OS user plus an explicitly configured account email
    answers the attribution question for the estate that installed the sensor.

If account email is wanted later, it should be configuration an admin sets
during deployment, not something scraped from a file the user did not know was
being read.

Scope

core/audit/run_context.py and core/config.py. Additive to the schema, so
1.2.0 stands. Touches nothing under the detection freeze.

Needs a test that a fresh install no longer produces local, and one that an
explicit AGENTMETRY_OPERATOR_ID still wins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions