Redact credentials on the way into a stored chat
A stored transcript is replayed into a later prompt when reopened, so a key typed while changing a setting would be handed back to the model on every subsequent turn.
This commit is contained in:
@@ -386,8 +386,11 @@ if ($action === 'ask') {
|
||||
. ' >/dev/null 2>&1 </dev/null &';
|
||||
$out = []; $rc = 0;
|
||||
exec($cmd, $out, $rc);
|
||||
// Redacted before it is logged, for the same reason the stored transcript is: asking the
|
||||
// assistant to set a credential means typing one, and ai.log is neither 0600 nor pruned.
|
||||
vv_ai_log(sprintf('ask token=%s rc=%d profile=%s kind=%s q=%s',
|
||||
substr($token, 0, 12), $rc, $profile, $kind ?: '-', mb_substr($question, 0, 80)));
|
||||
substr($token, 0, 12), $rc, $profile, $kind ?: '-',
|
||||
mb_substr(vv_ai_redact($question), 0, 80)));
|
||||
|
||||
echo json_encode(['ok' => true, 'token' => $token]);
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user