This research is motivated by the lack of empirical studies that connect the implementation of the code of ethics for borrowing and returning with the level of compliance of library users in the public library environment, especially at the Archives and Libraries Office of West Sumatra Province. The purpose of this study is to determine the extent to which the code of ethics for borrowing and returning affects the compliance behavior of library users in using library services. This research uses a quantitative approach with descriptive methods. A sample of 100 respondents was selected from a population of 17,000 users using simple random sampling technique. Data were collected through Google Form-based online questionnaires, observations, and interviews, and analyzed using descriptive statistical techniques and multiple linear regression using SPSS 25. The results showed that both the borrowing and returning codes of conduct had a positive and significant effect on the level of compliance, with the returning code of conduct having a more dominant influence (regression coefficient 1.130 and beta value 0.428). Simultaneously, the two variables explained 36% of the variation in library patron compliance. In conclusion, a clear and consistent implementation of the code of conduct, especially in the aspect of returning collections, contributes significantly to increasing library patron compliance. This study confirms the importance of socializing the rules, the active role of librarians, and strengthening the educational sanction system to form a responsible literacy culture in the library environment.