Fully autonomous AI Agents system capable of performing complex penetration testing tasks
Go ai-agentsai-security-toolanthropicautonomous-agentsgolanggptgraphqlmulti-agent-systemoffensive-securityopen-sourceopenaipenetration-testingpenetration-testing-toolsreactsecurity-automationsecurity-testingsecurity-toolsself-hosted
fix(frontend): valid prompt-id guard + form-field a11y attrs
Sergey Kozyrenko3346387cee69
diff --git a/frontend/src/components/layouts/main-sidebar.tsx b/frontend/src/components/layouts/main-sidebar.tsxindex 483665b2..56041c6a 100644--- a/frontend/src/components/layouts/main-sidebar.tsx+++ b/frontend/src/components/layouts/main-sidebar.tsx@@ -378,9 +378,12 @@ export function MainSidebar() {<SidebarRail /><input+ aria-hidden="true"className="hidden"key={resourcesUpload.fileInputKey}multiple+ name="resource-upload"+ tabIndex={-1}type="file"{...resourcesUpload.fileInputProps}/>diff --git a/frontend/src/features/flows/files/flow-files.tsx b/frontend/src/features/flows/files/flow-files.tsxindex 5a640980..463f5afe 100644--- a/frontend/src/features/flows/files/flow-files.tsx+++ b/frontend/src/features/flows/files/flow-files.tsx@@ -198,9 +198,12 @@ function FlowFiles() {{...dragHandlers}><input+ aria-hidden="true"className="hidden"key={upload.fileInputKey}multiple+ name="flow-file-upload"+ tabIndex={-1}type="file"{...upload.fileInputProps}/>diff --git a/frontend/src/features/flows/flow-form.tsx b/frontend/src/features/flows/flow-form.tsxindex 7f2c771f..8568b340 100644--- a/frontend/src/features/flows/flow-form.tsx+++ b/frontend/src/features/flows/flow-form.tsx@@ -30,7 +30,7 @@ import {DropdownMenuSeparator,DropdownMenuTrigger,} from '@/components/ui/dropdown-menu';-import { Form, FormControl, FormField, FormLabel } from '@/components/ui/form';+import { Form, FormControl, FormField, FormItem, FormLabel } from '@/components/ui/form';import {InputGroup,InputGroupAddon,@@ -649,7 +649,7 @@ export function FlowForm({<TooltipProvider><Tooltip><TooltipTrigger asChild>- <div className="flex items-center">+ <FormItem className="flex flex-row items-center gap-0"><FormControl><Switchchecked={useAgentsField.value}@@ -665,7 +665,7 @@ export function FlowForm({>Use Agents</FormLabel>- </div>+ </FormItem></TooltipTrigger><TooltipContent><p className="max-w-48">@@ -790,10 +790,13 @@ export function FlowForm({/></form><input+ aria-hidden="true"className="hidden"multiple+ name="flow-form-attachment"onChange={handleFileInputChange}ref={fileInputRef}+ tabIndex={-1}type="file"/><ConfirmationDialogdiff --git a/frontend/src/lib/route-titles/format-prompt-id.ts b/frontend/src/lib/route-titles/format-prompt-id.tsindex e0f61b79..2982a513 100644--- a/frontend/src/lib/route-titles/format-prompt-id.ts+++ b/frontend/src/lib/route-titles/format-prompt-id.ts@@ -2,6 +2,16 @@* Converts a camelCase prompt key (e.g. "agentSelector") into a display* label ("Agent Selector"). Shared between the prompt detail page header* and the route handle title.+ *+ * Returns a generic "Prompt" fallback when the input does not look like+ * a camelCase identifier — e.g. when the URL contains an invalid id such+ * as `/settings/prompts/99999`. Without this guard the route title would+ * render the raw id (`"99999 — PentAGI"`).*/-export const formatPromptId = (key: string): string =>- key.replaceAll(/([A-Z])/g, ' $1').replace(/^./, (str) => str.toUpperCase());+export const formatPromptId = (key: string): string => {+ if (!/^[a-z][a-zA-Z]*$/.test(key)) {+ return 'Prompt';+ }++ return key.replaceAll(/([A-Z])/g, ' $1').replace(/^./, (str) => str.toUpperCase());+};diff --git a/frontend/src/pages/resources/resources.tsx b/frontend/src/pages/resources/resources.tsxindex 6a6fe6ed..b3baf1e1 100644--- a/frontend/src/pages/resources/resources.tsx+++ b/frontend/src/pages/resources/resources.tsx@@ -465,9 +465,12 @@ function Resources() {{...dragHandlers}><input+ aria-hidden="true"className="hidden"key={upload.fileInputKey}multiple+ name="resource-upload"+ tabIndex={-1}type="file"{...upload.fileInputProps}/>