MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _prompt_folder_trust

Function _prompt_folder_trust

src/cli.py:215–253  ·  view source on GitHub ↗

Plain-text folder-trust prompt (port of the C8 TrustFolderScreen). Accept → persist (``record_trust_accepted``) + grant session trust + apply the full env. Decline/EOF → False (caller exits 1, mirroring TS TrustDialog's "No, exit" → gracefulShutdownSync(1)).

()

Source from the content-addressed store, hash-verified

213
214
215def _prompt_folder_trust() -> bool:
216 """Plain-text folder-trust prompt (port of the C8 TrustFolderScreen).
217
218 Accept → persist (``record_trust_accepted``) + grant session trust +
219 apply the full env. Decline/EOF → False (caller exits 1, mirroring TS
220 TrustDialog's "No, exit" → gracefulShutdownSync(1)).
221 """
222 from src.permissions.trust_boundary import establish_session_trust
223 from src.services.startup_gates import (
224 collect_trust_warnings,
225 record_trust_accepted,
226 )
227
228 cwd = os.getcwd()
229 print("Do you trust the files in this folder?")
230 print(f" {cwd}")
231 try:
232 warnings = collect_trust_warnings()
233 except Exception:
234 warnings = []
235 if warnings:
236 print()
237 for warning in warnings:
238 print(f" ! {warning}")
239 print()
240 print(
241 "ClawCodex may read, execute, and modify files here. Accept only if "
242 "you trust this folder's contents and configuration."
243 )
244 try:
245 answer = input("Trust this folder? [y/N] ").strip().lower()
246 except (EOFError, KeyboardInterrupt):
247 print()
248 return False
249 if answer not in ("y", "yes"):
250 return False
251 record_trust_accepted()
252 establish_session_trust()
253 return True
254
255
256def _build_parser() -> argparse.ArgumentParser:

Callers 1

_gate_folder_trustFunction · 0.85

Calls 3

collect_trust_warningsFunction · 0.90
record_trust_acceptedFunction · 0.90
establish_session_trustFunction · 0.90

Tested by

no test coverage detected