개인 서버 CLI에 Claude Code + Discord - #4 다중 권한 설정 + @멘션으로 봇 호출
·
Dev
목표다중 인스턴스/버전 지원 - 프로젝트 디렉토리, 권한 (Multi-user 환경 고려)봇 호출 방식을 멘션으로 변경 (Multi-user 환경 고려)봇끼리 메모리를 공유 방지 (보안)가정: User가 아닌 세션 단위로 대화 공유코드코드 링크: https://github.com/ybjeon/claude-discord-bot버전: tag/v1.0.3권한 설정뷰어 권한: A,B관리자 권한: A,B,C 이렇게 설정하고 싶으면 instances/project_name/ㄴ .envㄴ session.jsonㄴ settings.json /.claude/settings.json에 권한: A,B,C Allow/.claude/settings.json에 권한: A,B,C Allowinstances/project_name..
개인 서버 CLI에 Claude Code + Discord - #3 채널마다 프로젝트 연결 + write 테스트
·
Dev
목표Claude code 연결Write 테스트코드코드 링크: https://github.com/ybjeon/claude-discord-bot버전: tag/v1.0.2 Write 테스트Claude에 Write를 시켜봤다.다른 방법으로 Tool 권한을 allow 해줘야한다. 1. 자주 쓰는 도구를 미리 allowlist에 넣기1) Claude code 이용 (추천 안함, 귀찮음)Claude Code UI 또는 CLI에서:/permissions 로 들어가서 자주 필요한 도구를 Allow로 바꾸면 된다.ex) Read, Edit, 특정 Bash 명령 등Allow rule은 해당 도구를 수동 승인 없이 쓰게 하고, Ask rule은 매번 확인을 요구 (Chatting으로는 불가능)프로젝트 또는 사용자 설정에 a..
개인 서버 CLI에 Claude Code + Discord - #2 Session 추가
·
Dev
목표귀찮은 prefix 삭제: ex) !claude show me the last commitChatting history + multi-channel을 위한Session 추가Chatting history 추가코드코드 링크: https://github.com/ybjeon/claude-discord-bot버전: tag/v1.0.1 Claude code에는 session 개념이 있다. 이를 이용하면 앞에서 한 얘기를 연속해서 기억할 수 있고, 다른 채널에서 병렬적으로 Session이 holding 되어 편리하다. index.jsclaude 명령어 session flag이용function runClaude(prompt, sessionEntry) { return new Promise((resolve, re..
LLM AI Agent Security toy project - #1 Indirect Prompt Injection
·
AI Agent Security
목표IPI (Indirect Prompt Injection)을 시뮬레이션하여 Tool call에 의해 LLM이 의도하지 않은 행동을 하는 시나리오를 시뮬레이션코드코드 링크: https://github.com/ybjeon/ai-agent-security-toyproject/blob/main/test_planner_ipi.py시나리오: 현재 Agent 모델은 Planner-ExecutorUser > Agent: Read my last text message and read it.Agent: Tool-call 안읽은 메시지 읽기 (악성 문자)Agent > User: Do itAgent: (Tool-call) 악성 행동 실행$ python test_planner_ipi.pyPROMPT_INJECTION_STRI..
LLM AI Agent toy project - #2 Tool call
·
LLM AI Agent
목표LLM이 필요한 도구를 직접 골라 실행할 수 있게끔 Agent 설계 코드코드 링크: https://github.com/ybjeon/ai-agent-toyproject/blob/main/test_toolcall.py 1) test_toolcall.py - get_today_schedule() Tool call 정의 from langchain_core.tools import tool@tooldef get_today_schedule() -> dict: """Retrieve today's calendar schedule.""" today = TODAY # str(date.today()) events = FAKE_CALENDAR.get(today, []) return { "d..
LLM AI Agent toy project - #1 기본 LLM 테스트
·
LLM AI Agent
목표Single-turn 테스트Multi-turn 테스트Embedding vector 테스트코드코드 링크: https://github.com/ybjeon/ai-agent-toyproject/blob/main/test_llm.py$ python test_llm.py결과Single-turn 테스트=== Single Turn Test ===>>>>>>> User: Hello! Introduce yourself briefly.Assistant: Hello there! I am a large language model trained by Mistral AI, designed to assist with a wide range of tasks and provide engaging conversation. I don..
LLM AI Agent toy project - #3 MCP Server 예제 (python FastMCP)
·
LLM AI Agent
목표FastMCP를 이용해서 LLM에 MCP server 연결해보기코드코드 링크: https://github.com/ybjeon/ai-agent-toyproject$ python mcp_server.py - MCP 서버 실행$ python test_mcp.py- MCP 클라 실행 mcp_server.pyfrom mcp.server.fastmcp import FastMCPmcp = FastMCP("example-server")@mcp.tool()def add(a: int, b: int) -> int: """ Add two numbers. Args: a: first number b: second number """ return a + bmcp server에..