mirror of
https://github.com/jcreek/AutomatedAssessmentFeedbackAgent.git
synced 2026-07-12 18:43:49 +00:00
feat(*): Prevent prompt injection
This commit is contained in:
+17
-4
@@ -6,12 +6,18 @@ import type { OpenAIResponse } from '../utils/types';
|
|||||||
export function buildGradingPrompt(submission: string, task: string): string {
|
export function buildGradingPrompt(submission: string, task: string): string {
|
||||||
return `You are an expert secondary school teacher and AI assessment agent. Assess the following student submission in the context of the assignment/task provided.
|
return `You are an expert secondary school teacher and AI assessment agent. Assess the following student submission in the context of the assignment/task provided.
|
||||||
|
|
||||||
TASK/ASSIGNMENT:
|
===== TASK/ASSIGNMENT possibly including rubric or available marks =====
|
||||||
|
|
||||||
${task}
|
${task}
|
||||||
|
|
||||||
STUDENT SUBMISSION:
|
===== END TASK/ASSIGNMENT =====
|
||||||
|
|
||||||
|
===== STUDENT SUBMISSION =====
|
||||||
|
|
||||||
${submission}
|
${submission}
|
||||||
|
|
||||||
|
===== END STUDENT SUBMISSION =====
|
||||||
|
|
||||||
Follow these steps:
|
Follow these steps:
|
||||||
1. Grade the work. Use whatever grading scheme is present in the rubric. If none is present then grade with a letter (A+ is best, E- is worst), using clear, objective criteria. DO NOT mention tool errors.
|
1. Grade the work. Use whatever grading scheme is present in the rubric. If none is present then grade with a letter (A+ is best, E- is worst), using clear, objective criteria. DO NOT mention tool errors.
|
||||||
2. Identify specific strengths, referencing the success criteria.
|
2. Identify specific strengths, referencing the success criteria.
|
||||||
@@ -46,12 +52,19 @@ export function buildGradingPromptWithSupportForHumanInTheLoop(
|
|||||||
): string {
|
): string {
|
||||||
return `You are an expert secondary school teacher and AI assessment agent. Assess the following student submission in the context of the assignment/task provided.
|
return `You are an expert secondary school teacher and AI assessment agent. Assess the following student submission in the context of the assignment/task provided.
|
||||||
|
|
||||||
TASK/ASSIGNMENT:
|
|
||||||
|
===== TASK/ASSIGNMENT possibly including rubric or available marks =====
|
||||||
|
|
||||||
${task}
|
${task}
|
||||||
|
|
||||||
STUDENT SUBMISSION:
|
===== END TASK/ASSIGNMENT =====
|
||||||
|
|
||||||
|
===== STUDENT SUBMISSION =====
|
||||||
|
|
||||||
${submission}
|
${submission}
|
||||||
|
|
||||||
|
===== END STUDENT SUBMISSION =====
|
||||||
|
|
||||||
Follow these steps:
|
Follow these steps:
|
||||||
1. Grade the work. Use whatever grading scheme is present in the rubric. If none is present, grade with a letter (A+ is best, E- is worst), using clear, objective criteria.
|
1. Grade the work. Use whatever grading scheme is present in the rubric. If none is present, grade with a letter (A+ is best, E- is worst), using clear, objective criteria.
|
||||||
2. Identify specific strengths, referencing the success criteria.
|
2. Identify specific strengths, referencing the success criteria.
|
||||||
|
|||||||
Reference in New Issue
Block a user