This commit is contained in:
Alexander Myasoedov
2025-04-03 20:43:53 +03:00
parent 47ca656d59
commit 0dc738a11e
3 changed files with 38 additions and 30 deletions
+4 -4
View File
@@ -11,13 +11,13 @@ server_params = StdioServerParameters(
)
async def run()-> None:
async def run() -> None:
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
# Initialize the connection --> connection doesnt work
# Initialize the connection --> connection does not work
await session.initialize()
# List available prompts, resources, and tools --> no avalialbe tools
# List available prompts, resources, and tools --> no avalialbe tools
prompts = await session.list_prompts()
print(f"Available prompts: {prompts}")
@@ -27,7 +27,7 @@ async def run()-> None:
tools = await session.list_tools()
print(f"Available tools: {tools}")
# Call the echo tool --> echo tool iisue
# Call the echo tool --> echo tool iisue
echo_result = await session.call_tool(
"echo_tool", arguments={"message": "Hello from client!"}
)
+8 -8
View File
@@ -17,11 +17,11 @@ async def verify_llm(spec: str) -> dict:
"""
Verify an LLM model specification using the FastAPI server
Returns:
dict: containing the verification result form the FastAPI server
Returns:
dict: containing the verification result form the FastAPI server
Args: spect(str): The specification of the LLM model to verify.
"""
url = f"{AGENTIC_SECURITY}/verify"
async with httpx.AsyncClient() as client:
@@ -40,13 +40,13 @@ async def start_scan(
Start an LLM security scan via the FastAPI server.
Returns:
dict: The scan initiation result from the FastAPI server.
Args:
Args:
llmSpec (str): The specification of the LLM model.
maxBudget (int): The maximum budget for the scan.
optimize (bool, optional): Whether to enable optimization during scanning. Defaults to False.
enableMultiStepAttack (bool, optional): Whether to enable multi-step attack
enableMultiStepAttack (bool, optional): Whether to enable multi-step attack
"""
url = f"{AGENTIC_SECURITY}/scan"
payload = {