시스템 프롬프트
시스템 프롬프트는 대화가 시작되기 전에 놓여 모델의 역할과 어조, 금지 사항, 출력 형식을 세션 내내 고정하는 지시문이다. 사용자가 쓰는 메시지와 달리 애플리케이션 개발자가 작성하며, 주제가 바뀌어도 계속 문맥에 남아 적용된다. 보통 어시스턴트의 성격을 정의하고, 무엇을 거절해야 하는지 명시하고, 호출할 수 있는 도구를 설명하고, 답변을 어떤 구조로 낼지 지정한다. 제품 정책이 실제로 코드화되는 자리이기도 하다. 고객지원 봇에는 자사 제품 범위를 벗어나지 말라고 적고, 코딩 어시스턴트에는 저장소가 쓰는 프레임워크를 알려 준다. OpenAI와 Anthropic, Google 모두 API에서 이를 별도 필드로 두고 있고, 모델도 일반 사용자 입력보다 이 지시를 더 무겁게 다루도록 학습된다. 함정은 이것을 보안 경계로 착각하는 것이다. 모델이 읽는 문서나 웹페이지, 도구 결과에 지시를 숨겨 넣는 프롬프트 인젝션으로 시스템 프롬프트가 무력화되거나 유출될 수 있다. 진짜 민감한 값은 프롬프트가 아니라 서버 코드에 둬야 한다. 긴 시스템 프롬프트는 매 요청마다 컨텍스트 윈도우를 잡아먹는다는 점도 고려해야 한다.
A System Prompt is the instruction placed before a conversation begins that fixes a language model's role, tone, boundaries, and output format for every turn that follows. Unlike a user message, it is written by the application developer rather than the person chatting, and it stays in context for the whole session, so the model keeps applying it even as the topic changes. A typical system prompt names the assistant's persona, states what it must refuse, describes the tools it may call, and specifies how answers should be structured. It is where product teams encode policy: a customer-support bot is told to stay on the company's products, a coding assistant is told which frameworks the repository uses. OpenAI, Anthropic, and Google all expose this as a separate field in their APIs, and models are trained to weight it above ordinary user input. The pitfall is treating it as a security boundary. Prompt injection — instructions hidden in a document, web page, or tool result the model reads — can override or leak a system prompt, so anything genuinely sensitive belongs in server-side code, not in the prompt. Long system prompts also consume context window on every request.
사용 예시
- •“시스템 프롬프트에 응답 형식과 거절 기준을 명시해 챗봇 답변을 일정하게 유지한다”
- •“웹페이지에 숨긴 지시문으로 시스템 프롬프트를 우회하는 프롬프트 인젝션 사례가 늘고 있다”
- •“시스템 프롬프트가 길어질수록 요청마다 소모되는 토큰 비용도 함께 늘어난다”