Skip to content

g1t/apps/docs/src/content/docs/guides/audit-log.md

120 lines6,524 bytesCodeBlame
1---
2title: Audit log
3description: Every action agents take with their run credentials, and every change people and tokens make, with whether it was allowed and the rule that decided.
4---
5
6Every workspace keeps an audit log. It records:
7
8- **Everything an agent does** with its [run credentials](/guides/working-with-g1t/#credentials),
9 reads included: every API and MCP call, every clone and fetch, every push.
10- **Every change people and workspace tokens make** through the API, the
11 MCP server and git: opening and closing issues, comments, merges,
12 settings, pushes. Reads by people are not recorded.
13
14- **A repository's lifecycle**, wherever the change was made, g1t.sh
15 included. A transfer is recorded in both workspaces' logs, and a
16 workspace's deletion as `workspace.deleted`. A restore by g1t's support
17 is recorded as `workspace.restored`, and the purge 30 days after a
18 deletion as `workspace.purged`, its log's last entry.
19
20| Action | Recorded when |
21| --- | --- |
22| `repo.renamed` | A repository was renamed. |
23| `repo.visibility_changed` | It was made public or private. |
24| `repo.default_branch_changed` | Its default branch changed. |
25| `branch.renamed` | A branch was renamed. |
26| `repo.archived`, `repo.unarchived` | It was archived, or unarchived. |
27| `repo.transferred` | It moved to another workspace. |
28| `repo.deleted`, `repo.restored`, `repo.purged` | It was deleted, restored, or removed for good. |
29| `repo.collaborator_added`, `repo.collaborator_role_changed`, `repo.collaborator_removed` | Someone was given a role on it, had it changed, or lost it. See [access and roles](/guides/access-and-roles/). |
30| `repo.invitation_created`, `repo.invitation_revoked` | Someone was invited to it, or an invitation was withdrawn. |
31| `workspace.base_permission_changed` | An owner changed what members get on every repository. |
32| `workspace.team_creation_changed` | An owner changed who can create teams. See [who can create teams](/guides/teams/#who-can-create-teams). |
33| `team.created`, `team.edited`, `team.deleted` | A [team](/guides/teams/) was created, changed or deleted. |
34| `team.member_added`, `team.member_role_changed`, `team.member_removed` | Someone was added to a team, made its maintainer or a member, or taken out of it. |
35| `team.repo_added`, `team.repo_role_changed`, `team.repo_removed` | A team was given a role on a repository, had it changed, or lost it. |
36| `workspace.residency_changed` | An owner changed where the workspace's new repositories are stored. See [data residency](/guides/workspaces/#data-residency). |
37| `workspace.deleted`, `workspace.restored`, `workspace.purged` | An owner deleted the workspace, g1t's support restored it, or it was removed for good. See [deleting a workspace](/guides/workspaces/#delete-a-workspace). |
38
39Through the API and the MCP server, the call itself is recorded under its
40operation's name too, such as `delete_repo`. See
41[managing a repository](/guides/managing-repositories/).
42
43Refusals are recorded too, with the rule that refused them. Entries are
44only ever added: nothing edits or removes one.
45
46## What an entry says
47
48| Field | What it is |
49| --- | --- |
50| Time | When it happened, to the millisecond. |
51| Actor | Who did it: a person, an agent, or a workspace token. |
52| On behalf of | For an agent, the person it worked for: `g1t on behalf of syntaqx`. |
53| Run | The agent run, with its kind: `implement`, `review`, `update` and so on. |
54| Credential | The id of the token used. |
55| Action | The API or MCP operation, such as `create_issue`, or `git.push` and `git.fetch`. |
56| Target | The repository, the issue or pull request number, and for git the refs it moved. |
57| Outcome | `allowed` or `denied`. |
58| Rule | What decided it: the run's scope, such as `run:implement/tools`; a refusal rule, such as `scope:repository`; or, for people, their own access. A refusal by the repository's own rules is `service` (or `repository` for git). |
59| Result | `ok`, or the reason it failed. |
60| Request id | The request's id, the same one Cloudflare logs it under. |
61
62The rules that refuse an agent are listed under
63[credentials](/guides/working-with-g1t/#credentials).
64
65## Read the log
66
67Open the workspace's settings and choose **Audit log**, or go to
68`g1t.sh/<workspace>/-/audit`.
69
70- **Owners** see everything in the workspace.
71- **Members** see what was done to the workspace's projects, and anything
72 they did, or had done on their behalf. Changes owners made to the
73 workspace itself are for owners.
74
75Filter by actor (a person matches what they did and what agents did for
76them), agent, action, project, outcome, who acted, and a range of days.
77The filters are part of the page's address, so a filtered view can be
78shared with anyone who can see it.
79
80Each agent run's page has a **What it did** section listing its entries in
81order, and a pull request's **Agent** panel shows the latest of what its
82runs did. Both link to the full log, filtered to the run.
83
84## How long it is kept
85
86How far back the log goes depends on the workspace's plan:
87
88| Workspace | Kept |
89| --- | --- |
90| Free | **7 days** |
91| On the [g1t plan](/guides/usage-and-billing/#the-g1t-plan) | **90 days** |
92| Paid for by an [enterprise](/guides/usage-and-billing/#enterprises-and-custom-terms) | **90 days** |
93| Longer, by arrangement | Up to **400 days** |
94
95The log can be read and exported back that far, and no further. Once a
96day, entries older than that are **deleted**, and cannot be brought back:
97export what you need to keep before then. Starting the plan keeps 90 days
98from then on; entries already deleted stay deleted. Ending it goes back to
997 days, and the next daily pass deletes what is older.
100
101For a longer log, such as for a compliance requirement, email
102[support@g1t.sh](mailto:support@g1t.sh). g1t can set the workspace's
103account to keep up to 400 days, and what is set there takes the place of
104the plan's. A [self-hosted](/guides/self-hosting/) g1t that does not charge
105keeps 90 days for every workspace.
106
107## Export
108
109**CSV** and **JSON** on the Audit log page download what the current
110filters match, up to 10,000 entries, newest first. The CSV has one column
111for each field above; a cell that a spreadsheet would read as a formula is
112written as text.
113
114## What is not recorded
115
116- Reads by people and workspace tokens.
117- What people do on the website itself. The API, the MCP server and git
118 are recorded.
119- What g1t does on its own, such as closing a pull request whose agent
120 failed. Those changes are in the pull request's timeline.