earendil-works/pi · error
Project is not trusted; refusing to write project settings
Error message
Project is not trusted; refusing to write project settings
What it means
Security guard assertProjectTrustedForWrite in SettingsManager: an attempt was made to persist a change to project-level settings, but the project directory has not been marked trusted in this session. Writes are refused so untrusted repos cannot persist settings that would execute in later sessions.
Solutions
- Trust the project first (accept the trust prompt on startup or the trust command), then retry the settings write
- Write the setting at user level instead of project level if it should apply globally
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/coding-agent/src/core/settings-manager.ts:575 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/4375ad88ad729a55.
Report an issue: GitHub.
Appendix: source
Thrown at packages/coding-agent/src/core/settings-manager.ts:575
}
this.modifiedNestedFields.get(field)!.add(nestedKey);
}
}
/** Mark a project field as modified during this session */
private markProjectModified(field: keyof Settings, nestedKey?: string): void {
this.modifiedProjectFields.add(field);
if (nestedKey) {
if (!this.modifiedProjectNestedFields.has(field)) {
this.modifiedProjectNestedFields.set(field, new Set());
}
this.modifiedProjectNestedFields.get(field)!.add(nestedKey);
}
}
private assertProjectTrustedForWrite(): void {
if (!this.projectTrusted) {
throw new Error("Project is not trusted; refusing to write project settings");
}
}
private recordError(scope: SettingsScope, error: unknown): void {
this.errors.push(toSettingsError(scope, error, this.settingsPaths[scope]));
}
private clearModifiedScope(scope: SettingsScope): void {
if (scope === "global") {
this.modifiedFields.clear();
this.modifiedNestedFields.clear();
return;
}
this.modifiedProjectFields.clear();
this.modifiedProjectNestedFields.clear();
}
View on GitHub (pinned to 4af9d21d3b)