가드레일

Guardrails

모델 앞뒤에 검사와 제한을 두어 허용되지 않은 입력·출력을 처리합니다.

···
html
<div class="scene"><div class="heading">TWO CHECKPOINTS</div><div class="gates"><div id="input">입력 검사</div><span>→</span><div id="model">모델</div><span>→</span><div id="output">출력 검사</div></div><div class="status" id="gate-status">요청 검사 중</div></div>
css
.scene{width:min(94vw,800px);height:min(88vh,326px);padding:clamp(10px,2.7vmin,19px);border:1px solid var(--line);border-radius:13px;background:var(--surface);font:500 clamp(13px,2.4vmin,17px)/1.3 var(--font-sans,sans-serif);position:relative;overflow:hidden}.scene .mono{font-family:ui-monospace,SFMono-Regular,monospace}.scene .muted{color:var(--muted)}.scene .accent{color:var(--accent)}.scene .heading{font-weight:750;color:var(--accent);margin-bottom:clamp(5px,1.6vmin,12px)}.gates{display:flex;align-items:center;justify-content:space-between;gap:4px;height:64%}.gates div{width:29%;height:65%;border:1px solid var(--line);border-radius:8px;display:grid;place-items:center;text-align:center;background:var(--bg);transition:.3s}.gates div.active{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 17%,var(--surface));color:var(--accent)}.gates span{color:var(--accent)}.status{padding:7px;border-left:3px solid var(--accent);background:var(--bg)}
js
const ids=['input','model','output'],notes=['요청 검사 중','허용된 요청 생성 중','응답 형식 확인 중'];let i=0;function draw(){ids.forEach((id,n)=>document.getElementById(id).classList.toggle('active',n===i));document.getElementById('gate-status').textContent=notes[i];i=(i+1)%3}draw();setInterval(draw,800)

가드레일은 입력 검사, 도구 권한, 출력 형식 검사처럼 모델 실행 경계에 두는 통제 장치입니다. 한 단계만 믿기보다 실행 전후와 도구 호출 지점에 필요한 검사를 배치합니다.

데모는 요청이 입력 게이트를 지나고 응답이 출력 게이트에서 확인되는 순서를 보여줍니다. 검사도 누락이나 오탐이 가능하므로 민감한 작업에서는 별도의 권한 경계가 필요합니다.

언제 쓰나

모델이 도구를 쓰거나 사용자에게 정해진 형식의 결과를 내야 할 때 적용합니다.

페이지로 열기 ↗